angularjs - Get parent's scope array in directive -
sorry if duplicate can't find solution.
i have following:
appdrct.directive('jsonarray', [function () { homecoming { link: function (scope, element, attrs, ctrl) { console.log(scope.$parent.categories); } }; }]); which gives me empty array (categories not empty). if print this: console.log(scope.$parent);, can see array items inside! why that? , how can array?
edit: in modal view...
div(class="modal-header") div(json-array='categories')
use scope.categories...
scope.$parent.categories - right if have scope: true directive
angularjs angularjs-directive angularjs-scope
No comments:
Post a Comment