I had an interesting discussion with one of my colleagues. We are building a complex UI using angular, we have 2 different approaches
I am looking for more options and/or opinions about the 2 approaches mentioned above.
Checkout the Angular Style guide by John Papa https://github.com/johnpapa/angular-styleguide
This style guide contains all the best practices you need to know about AngularJS
Since you said you build a complex UI, I would strongly recommend using the second appraoch. The first one has just one average: its faster to write. The disadventages outweigh this by far. It will grow fast and you will lose track of what is happening what might lead to unsuspected behaviors. Its much harder to test and maintain. The second approach is also better when it comes to reusability which improves code quality.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.