Why color: "@"
work but color: "="
not work in the below code?
http://jsfiddle.net/edwardtanguay/pz2L6etv/8/
var myApp = angular.module('myApp',[]);
function mainController($scope) {
$scope.message = 'alsjkf';
}
myApp.directive('uiCalendar', function () {
return {
restrict: 'A',
scope: {
message: "@theMessage",
color: "=" //works with @
},
link: function (scope, element, attrs) {
scope.color = scope.color === undefined ? 'black' : scope.color;
$(element).append('<p style="color:'+scope.color+'">added this2: ' + scope.message + ' (' + scope.color + ')</p>');
}
};
});