-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Can't use piecemeal #1341
Comments
I also ran into this issue with ngMaterial, had to stop using strict mode DI. |
Add ng-annotate to your build process? |
@epelc Our team made the decision to explicitly declare our dependencies like this before I came on board. I'm certainly not opposed to ng-annotate, but, for this project, it can't happen. I created this issue in hopes that the material team will see the value in supporting those that use Strict DI without a build step for adding DI annotations.
Thank you for your suggestion :) |
@jpdesigndev - Using ng-annotate in the build process will build and deploy the angular-material.js (concatenated source) with the correct .$inject usages; e.g.
If you are using AngularJS Strict DI mode, this should not be a problem when using the build |
You can still use ng annotate even if half of your app declares the injections. I really don't see why you wouldn't want to use it. It saves a ton of time and reduces duplicate code. But it may be good to make angular material work wit hout it. |
@ThomasBurleson @epelc Sorry, it seems I wasn't getting notifications about these responses. @ThomasBurleson Perhaps, the thing your missing about my question is that I was looking to use angular-material pieces individually without including the entire framework as a single .js file. And, since our team hasn't introduced a "build on every save" step, and we're using Strict DI even when developing, it's virtually impossible. I agree that ng-annotate is a bit of a no brainer. And, I admit that, for my side project, I WILL NOT have these kinds of restrictions. But, as much as I like ng-annotate, building on the fly, etc, my entire team doesn't feel the same. So, in lieu of ng-annotate, my question is about using the pieces of angular material without getting the entire framework. I suppose it's a bit of a difficult ask. Let me see what else I can do on my end. Perhaps, something like will require a custom build of sorts on our own branch. |
@jpdesigndev - you can build the individual components yourself if you clone the repository and run npm update;
gulp build
# build the mdIcon component, demos, and files - see /dist/demos/icon for build assets
gulp build-demo -c icon We also auto-build each module individually for you. See the components in Bower Material Modules |
Woah! That's cool. Thank you @ThomasBurleson |
I'm upgrading from v0.5.1, and trying to use this framework piecemeal. Our application uses strict mode DI. Because the angular material framework doesn't use strict mode, Angular is throwing errors. Any ideas what can be done other than using the packaged version?
The text was updated successfully, but these errors were encountered: