knockout 2.0 - Re-using a knockoutJS 2 component within an Angular 2 TS component -
i'm in process of migrating project on angular2 w/ typescript written in knockoutjs. turning out quite cumbersome do, i'd re-use of components have written ko inside of angular2 ones trouble finding example of if possible.
my code follows:
mykocomponent.js
returns {viewmodel: myviewmodel, template:mytemplate} myangularcomponent.ts
//here want import mykocomponent there 2 things unsure how import component , reference object returns.
the pattern i've been using parent (ie myangularcomponent) append template element , call ko.applybinding(new myviewmodel, mytemplate), possible?
thank-you time!
this not i've tried, perhaps work
import {component, oninit} 'angular/core'; import {myviewmodel} './some-location'; declare var ko:any; @component{...} export class mycomponent implements oninit { ngoninit() { ko.applybindings(new myviewmodel()); } }
Comments
Post a Comment