Am new to angularJS, and am not able to make out why the directive is not getting called I have separate js file controller for app, separate js file directive for app; Trying to create separate files for each;
HTML Code
<vertical-table data='fieldsList'></vertical-table>
Controller Code
app.controller('MainCtrl', function($scope) { $scope.fieldsList =[{},{},{}]; });
Directive Code
angular.module('plunker').directive('verticaltable', function () {
console.log("field list initialzed");
return{
restrict: 'AE',
template: 'table.html',
replace: true,
transclude: true,
scope : {
data: "="
},
controller: function($scope, $elem){
console.log("controller");
},
link:function($scope, elem){
console.log("link");
}
};
});
.directive('verticalTable'instead of.directive('verticaltable',(notice the capital T in Table)