javascript - AngularJs Load dependencies files -
i'm learning angularjs , in tutorials , screencasts saw use angular writing code in unique file, example directives, controllers, factories etc...
logically large applications, split out code, make maintainable , flexible in multiple files , should careful how many <script> tags have require let our javascript files run correctly.
i know best practice require files when needed, importing less javascript files possible in view. took @ requirejs seems bit complicated use it. there tool more efficient , easy use? or resource started?
a small example can have sort of plugin has been built using directives, controllers , factories:
app-| --controllers |_ plugincontroller.js --directives |_ plugindirective.js --factories |_ pluginfactory.js instead of requiring 3 files how make work?
here' great example of how use requirejs , angularjs together. it's fork of angular seed project , should point in right direction. comes requirejs baked right in. recommend learning requirejs!
Comments
Post a Comment