Yes looks like that. https://angular.io/docs/ts/latest/guide/upgrade.html#!#how-the-upgrade-adapter-works
There are two key things to understand about what happens in the DOM of a hybrid application: 1. Every element in the DOM is owned by exactly one of the two frameworks. The other framework ignores it. If an element is owned by Angular 1, Angular 2 treats it as if it didn't exist, and vice versa. 2. *The root of the application is always an Angular 1 template.* On Tuesday, May 24, 2016 at 11:27:54 AM UTC+5:30, Abhi wrote: > > Hey Manish, Thanks for your solution. > Downgrading angular2 component to use with angular1 App is one such usage. > But what if I have to do the other way i.e consume angular1 directive into > an angular2 App. > That's what my use case is. I have a newly written angular2 App where I > want to use existing angular1 directive along with other angular2 > components. Are you saying that is not supported? > > About #2, I admit that's a typo. Even with template field, it doesn't > work. > > By the way, this was some months back with beta.1, I have not checked if > the problem still exist with rc builds. > > On Tuesday, May 24, 2016 at 7:52:42 AM UTC+5:30, Manish Pal wrote: >> >> Here's your code in working form >> https://plnkr.co/edit/VzuopVilmDK5sQaQcoDh?p=preview >> >> Couple of things: >> 1. you need to downgrade the ng2 component as well, because a hybrid ng1 >> + ng2 app would start as an ng1 app only. >> 2. your ng2 component was using templateUrl instead of template, even >> though it was giving an inline template. >> >> >> On Thursday, January 14, 2016 at 12:01:34 PM UTC+5:30, Abhi wrote: >>> >>> I am using UpgradeAdapter to use an angular1 directive in my angular2 >>> app. I followed the steps mentioned on angular2 upgrade guide >>> <https://angular.io/docs/ts/latest/guide/upgrade.html> >>> >>> See this plunk <https://plnkr.co/edit/qQMTa3IpUsREZvpaNmBH> for code. >>> It is resulting me into this error - >>> >>> EXCEPTION: No provider for $scope! (function (scope, elementRef) { -> >>> $scope) >>> >>> I have an angular1 directive which is element type, with controllerAs >>> style. Also I am not using $scope in the controller code. I am trying to >>> use this angular1 directive within my angular2 app. >>> >>> So I instantiate the UpgradeAdapter and call upgradeNg1Component method >>> on it with argument as name of my angular1 directive and I pass it in the >>> directive input for my angular2 component. >>> >>> But then it results in the above error. >>> >>> Any clue what I may be missing? >>> >> -- 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.
