I don't even know what to ask at this point (edit: I have been informed that it's unclear that my question is "Why isn't the directive seeing attributes passed to it"), I thought I understood it. Can't seem to use parent controller's properties inside the directive (yes, they do need to be optional, but I don't think that's the issue).
I thought I create an isolate scope: scope: {myVar: "=?"}
then simply create a myVar attribute and point it to "source" on parent controller. What am I doing wrong?
Fiddle: http://jsfiddle.net/x0mukxdd/
html:
<my-directive isDisabledDirectiveVar = "isDisabledOuterVar" insideDirectiveTestString = "someTestString" />
js:
var app = angular.module("myApp", []);
app.controller("myController", function ($scope) {
$scope.isDisabledOuterVar = true;
$scope.someTestString = 'blahblah I am a astring';
});
app.directive("myDirective", function () {
return {
restrict: 'E',
scope: {
isDisabledDirectiveVar: '=?',
insideDirectiveTestString: '=?'
},
template: '<input type = "text" ng-disabled= "isDisabledDirectiveVar"' +
'value = "{{insideTestString}}" ></input>'
};
});
Side note, reference article here.