質問

Here's a plnkr.

How do I access the headerInput model from within the sideMenuContent directive? Let's say I have 10 other ng-models in sideMenuHeader directive that I want to access in sideMenuContent, is there any way of making it easily scalable?

役に立ちましたか?

解決

You need to use the dot notation for objects. See Understanding Scopes in AngularJs

So instead of headerInput, use something like menu.headerInput and also make sure to initialize a menu object in your controller like so $scope.menu = {}; (or you can also set default values).

I updated your plunkr to show you how it works

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top