Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views. In this way you can reference variables and functions on a specific controller.

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answeranswer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views. In this way you can reference variables and functions on a specific controller.

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views. In this way you can reference variables and functions on a specific controller.

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();
Added some clarrification
Source Link

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views. In this way you can reference variables and functions on a specific controller.

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views. In this way you can reference variables and functions on a specific controller.

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();
Added self-excetuting functions
Source Link

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

Maybe not an complete answer. But what me really helped was the Angular StyleGuide By John Papa.

Overall it's a great start but I have some remarks:

Controller As

Try using controller as syntax. in particular when using nested views

<div ng-controller="BookController as book">
   {{ book.title}}
 </div>

This Keyword

When using controller as syntax the controller needs to use this keyword instead of $scope.

function BookController() {
   var vm = this;
   vm.title= {};
   vm.deleteBook= function() { };

}

Injection

When using minification you will get errors on the injection parameters you need to mannually specify the parameters.

angular
.module('app')
.controller('BookController', BookController);

BookController.$inject = ['books', 'data'];

function BookController(books,data) {}

self executing anonymous functions

Try to give every controller, route, config in a seperated file so you can use self executing anonymous functions. Enclose every controller,route, etc like this example. See this answer for more info.

(function () {
   'use strict';
    angular.module('app').controller('BookController', BookController);
})();
Source Link
Loading