I'm excited to share this article because it covers a real-world scenario of creating a UI. It focuses on being reusable meaning the directives used in the article can be used elsewhere and can be built upon.
The writer, Kevin Crawford, has brought some ideas from Flux and React back into AngularJS and he starts with some guiding principles for creating a maintainable user interface. The real-world scenario is creating a widget builder.
His guiding principles are:
The code is posted at Github.
- The Single Responsibility Principle (helps keep classes/objects small and doing only one thing)
- Separation of Concerns (separating the app into business logic and UI layers)
- Don't Repeat Yourself
He also has a live demo of the article
The article is also good if you want to see how the Jade template language looks like and if you want to check out how CoffeeScript looks.
Check out the article