angular js scope property is undefined
- by user2071301
why is $scope.orderBy undefined?
Shouldnt it be "test" ?
http://jsfiddle.net/XB4QA/4/
var app = angular.module("Foo", []);
app.directive("two", function () {
return {
scope: {
orderBy: '@'
},
restrict: 'E',
transclude: true,
controller: function ($scope, $element, $attrs) {
console.log($scope.orderBy); // is undefined, why?
},
template: '<div></div>',
replace: true
};
});
<div ng-app="Foo">
<two order-by="test">test</two>
</div>