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.