5 ms·
For Minification, Brian Ford's ngmin grunt task works perfectly. The OP says they haven't tried it which to me suggests that they may not be using grunt at all,
by marknutter 13y ago
For Minification, Brian Ford's ngmin grunt task works perfectly. The OP says they haven't tried it which to me suggests that they may not be using grunt at all, which is a mistake. Grunt takes care of a lot of workflow and deployment details, including minification, and should be part of every javascript developers toolset regardless of whether or not they use Angular.js.
For the "Directives are never 'done'" issue you should be able to attach any jQuery plugins to the DOM in question inside the directive compile function.
- SanderMak 13y agoCorrect, the particular system I encountered this minification issue has an Ant-based build (which calls r.js for concatenation and minification). I'll have to check on your compile suggestion. I tried lots of things, including using the postLink etc. Do you have an example?
- marknutter 13y agoHere's an example using the jQuery UI draggable plugin: http://jsfiddle.net/marknutter/hSbjX/4/ http://jsfiddle.net/marknutter/hSbjX/4/
- SanderMak 13y agoThanks! I also just found out about angular-ui-utils, where they have a generic pass-thru directive for initializing jQuery plugins. Interestingly, they opted to use $timeout inside the compile function: https://github.com/angular-ui/ui-utils/blob/master/modules/jq/jq.js https://github.com/angular-ui/ui-utils/blob/master/modules/j... Wonder why that is, are there cases that would otherwise break?
- marknutter 13y agoI'm not sure, that's a good question.
- KaoruAoiShiho 13y agoYou don't need grunt, you can use ngmin with any type of build process.
- marknutter 13y agoRight, I should have mentioned that. There are also alternatives to Grunt, but regardless, some sort of task running tool is a must in my book.