Skip to content

Instantly share code, notes, and snippets.

@christianvuerings
Created November 1, 2012 23:22
Show Gist options
  • Save christianvuerings/3997446 to your computer and use it in GitHub Desktop.
Save christianvuerings/3997446 to your computer and use it in GitHub Desktop.
Angular tips

Tips

  • Don't use a '$' prefix when naming your services and models, in order to avoid any possible naming collisions.

Useful

Minification and Angular

http://docs.angularjs.org/api/AUTO.$injector

$inject.invoke(['serviceA', function(serviceA){}]);

instead of

$inject.invoke(function(serviceA){});

We can also use

PhoneListCtrl.$inject = ['$scope', '$http'];

instead of

var PhoneListCtrl = ['$scope', '$http', function($scope, $http) { /* constructor body */ }];

Angular UI

http://angular-ui.github.com/

Angular seed project

A boilerplate for AngularJS https://github.com/angular/angular-seed

End to end testing

http://docs.angularjs.org/guide/dev_guide.e2e-testing

Hide curly brackets in html

<title ng-bind-template="Google Phone Gallery: {{query}}">Google Phone Gallery</title>

Dependency injection

http://docs.angularjs.org/guide/di

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment