AngularJS Cheat Sheets: Core Services, Directive Definition Object, and ui-router
- Best Practices for Building Angular.js Apps
- AngularJS Best Practices: Directory Structure
- Creating a useful AngularJS project structure and toolchain
- Angular App Structuring Guidelines
- A Practical Guide to AngularJS Directives
- A Practical Guide to AngularJS Directives, part 2
- Call parent's scope function inside directive's scope example
- Transclude example, Example 2
- Comunication between child and parent directives through controller
- Sample note app using custom directives
- Practical Guide to PreLink, PostLink and Controller Methods of Angular Directives
- Testing directives
- What is a 'Stateful' filter and why it is discouraged
- Filter with promise initialization (stateful filter example):
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Example of delayed filter initialization using promise in angular" />
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.js"></script>
<meta charset="utf-8">
<title>Delayed Filter</title>
</head>
<body ng-app="filterExample">
<h2>Promise in Angular Filter</h2>
<p>{{ 'a string' | aFilter }}</p>
<p>The above filter changes after 1 second using $timeout service.</p>
<p>Part of the blog post at <a href="http://bahmutov.calepin.co/">http://bahmutov.calepin.co/</a></p>
</body>
</html>
angular.module('filterExample', [])
.filter('aFilter', function registerAFilter($timeout) {
var filterFn = function initialFilter(str) {
return str + ' filtered initially';
};
$timeout(function () {
filterFn = function newFilter(str) {
return str + ' filtered with delayed!!!';
};
}, 1000);
function tempFilter(str) {
return filterFn(str);
};
tempFilter.$stateful = true;
return tempFilter;
});
- $apply, what is it and when you should use it
- Angular jqLite
- Configurable module components with providers
- $q
- $http vs $resource vs Restangular
- Links (relations) to REST resources in AngularJS
- HATEOAS and Linking with angular-hyper-resource
- Restmod
- Build a Simple REST Application with AngularJS Pt 2 Master Detail Interface
- JsHint config to avoid error messages while reading jasmine and karma functions
- Unit testing AngularJS applications
- Unit testing Karma + Jasmine slides
- Karma-browserfy example
- Testing JavaScript with Jasmine, Travis, and Karma
- Unit Testing in AngularJS: Services, Controllers & Providers => Example
- Provider test example
- Provider test example (2)
- AngularJS Testing Tips: Testing Directives
- Mocking Dependencies in AngularJS Tests
- Sample Restangular mock
- Testing older browsers
- Writing end-to-end tests has never been so fun
- "But, I want to use Protractor in a non-AngularJS app"
- Protractor Styleguide
- Example gulp file with protractor conf
- Protractor demo
- Testing Angular Apps End-to-End with Protractor
- Testing Angular and Non Angular Sites
- Creating test scripts using Protractor for non angular application
- Selenium tutorial: how to click a button
- jsDoc node module, angular-jsdoc node module.
- Writing AngularJS Documentation.
- Several choices
- Simple and clear Angular application documentation using angular-jsdoc
- Angular and Gulp (by John Pappa)
- Minify and templateCache your Angular Templates using Gulp
- 10 Awesome Gulp Plugins Working with AngularJS and Bower
- Useful Gulp plugins:
- Ensures correct order while injecting bower dependencies: gulp-angular-filesort
- AngularJS Performance in Large Applications
- 11 Tips to Improve AngularJS Performance
- JavaScript Memory Profiling with Chrome
- AngularJS support in Atom
- Unit test plugin for Atom
- 10 Popular AngularJS IDE Plugins/Extensions
- 15 Useful AngularJS Tools For Developers
- Angular seed
- Angular enterprise seed
- Angular express seed
- Full stack:
- Cleverstack
- jhipster:
- Configuration with Oracle:
- Promise callback not called in Angular JS
- Example from http://brianmcd.com/2014/03/27/a-tip-for-angular-unit-tests-with-promises.html#comment-1621301585:
describe('how to test with promises', function () {
var deferred, $rootScope;
beforeEach(function () {
inject(function ($q, _$rootScope_) {
$rootScope = _$rootScope_;
deferred = $q.defer();
});
});
it('does a thing one way', function() {
var value;
deferred.promise.then(function(_value_) {
value = _value_;
});
deferred.resolve(10);
expect(value).not. toBe(10); // not yet 10 because $digest hasn't run
$scope.$digest();
expect(value).toBe(10); // 10 because $digest already ran
});
});