Conventions Used In This Book
Code samples in this book are written in ES6, so you should have a solid grasp of ES6 features before continuing.
See: How to Learn ES6 by Eric Elliott & Babel's Learn ES2015 article.
Formation relies heavily on Angular
components
, introduced in version 1.5. You should familiarize yourself with this API before reading this guide.See: AngularJS's Understanding Components article.
The variable
vm
is commonly used throughout code samples and refers to a generic parent controller'scontrollerAs
alias.See: AngularJS's Controller As and the
vm
Variable by John Papaimport app from 'app';
is commonly used throughout code samples and refers to an Angular module reference. When using a module-bundler like Webpack, it is more terse and less error-prone to refer to an application's Angular module directly, by reference, rather than usingangular.module
to look it up.Prior to module-bundlers, this how Angular modules were referenced:
// app.js angular.module('MyApp', []);
// fooCtrl.js angular.module('MyApp').controller('FooCtrl', function () { // ... });
These files were then concatenated using some hack to ensure that
app.js
appeared in the output bundle beforefooCtrl.js
.With the advent of module-bundlers, it is much more practical to simply create a module that exports a reference to the Angular app:
// app.js import angular from 'angular'; export default angular.module('MyApp', []);
// fooCtrl.js import app from 'app'; app.controller('FooCtrl', function () { // ... });
// =>
is used to denote the result of evaluating of the preceding expression.'b' + 'a' + + 'a' + 'a'; // => 'baNaNa';