我想将我的ng-model从'outer-directive'传递给'inner-diretive'(包含在outer-directive模板中).
这样做的正确方法是什么?
HTML代码:
<body>
<outer-directive ng-model="prop" />
</body>
Run Code Online (Sandbox Code Playgroud)
和指令代码:
angular.module('app', []).directive('outerDirective', function(){
return {
template: '<inner-directive ng-model="prop" />',
link: function() { ... }
}
});
Run Code Online (Sandbox Code Playgroud)