Angular JS micro version (for learning).
It's developed for fun and to learn internals of the AngularJS framework.
And also to have a light version of it to train other people,
because it's much more easier to explain something about 400 lines of code, then about 10 000 loc.
It's not for production, it's not tested well, and there was no effort to optimize performance, so it's slow.
Only really basic features are implemented.
And they are implemented in a simplified form.
Also APIs may be different.
- predefined directives
- API for custom directives (
scopeproperties are available)
- controllers (slightly different syntax), nested controllers
- services (called factories in AngularJS) and values (shortcut)
- dependency injection and resolver (but only services and values could be injected)
- scopes, nested scopes
- expressions and parser (unlike in AngularJS it's implemented with
evalto simplify implementation)
- compilation (tree traversal) and applying directives
- dirty checking and digest cycle
Next directives are predefined:
- ng-render (one-time binding)
- ng-repeat (just recompiling, no optimizations)
What's not implemented
There are many features not implemented, mainly to not complicate the code.
It's simple actually to implement them within the built structure.
But it was decided it's superfluous when expressing the concept.
- modules and multiple ng-app
The numbers are indicated without empty lines and included underscore methods.
|the core||250 loc|
|with directives||400 loc|
There are 92 functions in this file.
Function with the largest signature take 3 arguments, while the median is 1.
Largest function has 8 statements in it, while the median is 2.
The most complex function has a cyclomatic complexity value of 6 while the median is 1.
So I hope it's easy to learn.
Author (Speransky Danil): Personal Page | LinkedIn | GitHub | StackOverflow