![]() ![]() I have put it inside the conveniently provided scripts folder.Įcho -e "$ccyellow=Minify=$ccend"įor infile in `find. You can put your build script anywhere you like, and run it from anywhere in the project folder. You can tell git to ignore this folder by adding the following line to. Adjacent to this, create a build folder to contain the minified and compressed output files generated by the build script. If you’re sticking to the folder structure provided by angular-seed, you’ll have an app folder in your project root. You can find a usage example here.Īdditionally, you can collate all content from controllers.js, directives.js, services.js and filters.js into app.js to reduce the number of calls made to the server.ĭon’t forget to modify your index.html / index-async.html to reflect this change. You need to use inline annotations in defining custom services. YUI Compressor changes closure parameter names, and this doesn’t go down well with Angular. ![]() However, this is not enough to get minified scripts working right. There is one more way defined on the site, but I prefer the method above. For the example above, it looks something like: PhoneListCtrl is part of the angular-phonecat application, used for driving the on-site tutorial.īasically, every controller defined by your application needs to be explicitly injected with whatever dependencies it has. Since angular infers the controller’s dependencies from the names of arguments to the controller’s constructor function, if you were to minify the JavaScript code for PhoneListCtrl controller, all of its function arguments would be minified as well, and the dependency injector would not be able to identify services correctly. The AngularJS docs provide some information on how to prepare controllers for minification here. Preparing AngularJS Scripts for Minification This one focuses on efficiently delivering the UI portion – HTML + CSS + JS + Media – which from a server POV is static content. I’ve had to sort out a lot of issues to get both to cooperate while running on different servers on different domains, use digest-based authentication instead of cookies (REST is stateless), and so on, but that’s another post.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |