aurelia - Dynamic view creation -


i'm trying simple dynamic view working simplest possible way.

import {inject, noview, viewcompiler, viewslot} 'aurelia-framework';  @noview @inject(viewcompiler, viewslot) export class buttonvm{      constructor(vc, vs){          this.viewcompiler = vc;         this.viewslot = vs;           var viewfactory =  this.viewcompiler.compile('<button>some button</button>'); 

but apparantly i'm missing something, view factory should able create view , should added viewslot?

what missing in above code?

i should mention tried follow rob's comments in thread: https://github.com/aurelia/templating/issues/35

see updated post rob in same thread.

import {inject, noview, viewcompiler, viewslot, container, viewresources} 'aurelia-framework';  @noview @inject(viewcompiler, viewslot, container, viewresources) export class test {     constructor(vc, vs, container, resources){         this.viewcompiler = vc;         this.viewslot = vs;          var viewfactory =  this.viewcompiler.compile('<button>${title}</button>', resources);         var bindingcontext = { title:'click me'};         var view = viewfactory.create(container, bindingcontext);         this.viewslot.add(view);         this.viewslot.attached();     } } 

Comments