I'm struggling with the code snippet below. The vm.name
variable doesn't seem to be working as expected. Additionally, why is the this
keyword inside the controller not being detected? I've defined a closed scope
for the directive, so what could be causing this issue?
Can anyone spot what I am doing incorrectly here?
var mod = angular.module('myApp', []);
mod.directive('myObj', myObject);
function myObject(){
return {
restrict: 'E',
templateUrl: 'my-obj.html',
scope: {},
controller: myController
};
function myController(){
var vm = this;
vm.name="vfdfbdn";
}
}