Ok this is dumb, it seems i have to declare the directive as 'myApp'
instead of 'my-app' when attaching in A1, it's kind of like when A2 changed
'ng-for' to 'ngFor', can someone explain this behavior even if in my html
im using:
<my-app>Loading...</my-app>
El martes, 22 de marzo de 2016, 8:54:00 (UTC-5), Carlos Esteban Lopez
Jaramillo escribió:
>
> Ok i have an A1 app bootstrapped using the A2 NgUpgrade bootstrap method,
> all good until i try to downgrade a component to use inside the app:
> import { UpgradeAdapter } from 'angular2/upgrade';
> import { Component } from 'angular2/core'
>
> @Component({
> selector: 'my-app',
> template: '<h1>My First Angular 2 App</h1><h2>{{str}}</h2>',
> })
> export class AppComponent {
> public str: string = 'This is a string dinamically loaded.'
> }
>
> declare var angular: any;
> var adapter: UpgradeAdapter = new UpgradeAdapter();
>
> angular.module('taoApp').directive('my-app', adapter.downgradeNg2Component
> (AppComponent)); // This is what doesn't work
>
> adapter.bootstrap(document.body, ['taoApp']);
>
> This is the simplest example, if this doesn't even work NgUpgrade is
> doomed, help?.
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.