asp.net core mvc - Angular2 component without view annotation -
i able use angular2 client-side databinding on server-rendered pages (asp.net mvc6).
is possible without adding @view template? instead of defining inline or creating external template, enclose block of server-rendered html app element. how did in angular1, allows me choose whether databind on server-side or on client-side.
thanks.
you can similar, want. take example:
import {component, view, bootstrap} "angular2/angular2"; @component({ selector: "app" }) @view({ template: "<content></content>" }) export class app { public name: string; constructor() { this.name = "myname"; } } bootstrap(app);
the template has special content <content></content>
represents ngtransclude directive. allow add content inside app tag:
<app> <h1>hello world</h1> </app>
unfortunately still poorly undocumented , changing it's hard tell actual limitations or if remain this.
regards.
Comments
Post a Comment