Hi,
I have created two directives(dirA, dirB). directiveA created scope
variable not working in directiveB nor in controller scope.
//DirectiveA
myApp.directive("directiveA", function () {
return {
restrict: "AE",
replace: true,
controller: 'myController',
scope: {
aData: "=aData", //input to the directive
cardData: "=cardData" //input to the directive
},
link : function(scope, element, attr) {
// some other code
},
templateUrl: 'directiveA.html'
};
});
//DirectiveB
myApp.directive("directiveB", function () {
return {
restrict: "AE",
replace: true,
controller: 'myController',
scope: {
bData: "=bData", //input to the directive
cardData: "=cardData" //input to the directive
},
link : function(scope, element, attr) {
// some other code
},
templateUrl: directiveB.html'
};
});
//directiveA.html
<div>
<span>Head A</span>
<div>
<input type="range" name="work_one" min='0' max=5' step="1"
data-ng-init="selectedA=0" data-ng-model="selectedA" data-ng -
change="getSupportBList(aData[selectedA]);" value="0" />
{{supportBList}} //Getting Proper result as
expected.
</div>
</div>
//myController.js
//........
$scope.getSupportBList= function(val) {
$scope.supportBList= ['B1', 'B2', 'B3', 'B4'];
};
//........
Now, when I am using the same {{supportBList}} in my controller view or in
the directiveB.html template it is not returning any value. After
inspecting with ng-inspector, the directiveA only have the "supportBList"
values. now, how can I make the "supportBList" available in the controller
view?
Any help would be greatly appreciated.
--
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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.