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 
  1. how import component , reference object returns.

  2. 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

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -