pbastowski / angular2-now

Angular 2 @Component syntax for Angular 1 apps
MIT License
145 stars 15 forks source link

How to get parent scope in view #22

Closed rvboris closed 9 years ago

rvboris commented 9 years ago

In this example i can not get myApp scope from a child state in views

rvboris commented 9 years ago

Update, i found {{$parent.myApp.test}}

pbastowski commented 9 years ago

@rvboris Yes, that's definitely one way to do it.

I have also updated the plunk to show how to access the parent component's controller in a child component's constructor function. See feature-two.js.