Controller not a function, got undefined, while defining controllers globally

With Angular 1.3+ you can no longer use global controller declaration on the global scope (Without explicit registration). You would need to register the controller using module.controller syntax. Example:- angular.module(‘app’, []) .controller(‘ContactController’, [‘$scope’, function ContactController($scope) { $scope.contacts = [“[email protected]”, “[email protected]”]; $scope.add = function() { $scope.contacts.push($scope.newcontact); $scope.newcontact = “”; }; }]); or function ContactController($scope) { $scope.contacts … Read more

What is the difference between ‘@’ and ‘=’ in directive scope in AngularJS?

Why do I have to use “{{title}}” with ‘@‘ and “title” with ‘=‘? @ binds a local/directive scope property to the evaluated value of the DOM attribute. If you use title=title1 or title=”title1″, the value of DOM attribute “title” is simply the string title1. If you use title=”{{title}}”, the value of the DOM attribute “title” … Read more