This presentation was featured on the third AngularJS Meetup in Belgium and presented by Glenn Dejaeger, Thomas Anciaux and Pieter Herroelen, who have been working on a large AngularJS application for almost a year now.
This presentation features the many challenges they have encountered and also ways to solve them, including:
- structuring a large AngularJS application (and building it with grunt)
- writing reusable components
- using AngularJS with a hypermedia API
Enjoy!
AE nv
4. Introduction
Glenn Dejaeger @glenndejaeger
Experience: 2+ years
Thomas Anciaux @thomaux
Experience: 2+ years
Pieter Herroelen @piether
Experience: 1 year
We work for AE @AE_NV
4
16. Bower
Setup each project as a Bower module
Publish versions independently
Bower can target local or zipped folders
Store the tagged versions anywhere you’d like
16
18. Conclusion
Advantages
Automation of build system
Closer to pure angular (easy Karma setup etc.)
Dependency management
Disadvantages
One big file per project/module
Harder to use Chrome Dev tools
18
21. Project needs
A lot of similar functionality (CRUD)
Hierarchical data
Flexible UI: “A browser in a browser”
Multiple tabs
Links all over the place
...
21
44. follow() Replace content of directive with
resource behind link
Example:
<a ng-click=“links[‘children’].follow()”></a>
44
45. function(method, data) Do an HTTP call
with the specified method and the specified data
in the request. Returns a promise.
Example:
$scope.links[‘save’](‘POST’, $scope.form).then(...);
45
59. What is a component?
An identifiable part of a larger program or
construction
Provides a particular function or group of related
functions
Has its own responsibility
59
72. Communication between components
Events
Loosely coupled
No control over listeners
Shared services
Tightly coupled
Control over consumers
72
73. Parting words
Solved a number of problems
Modularity of the build
Interaction with a hypermedia back-end
Modularity of the code
Created a few new problems
YMMV
73