Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

webpack example #33

Open
creimers opened this issue Mar 2, 2016 · 8 comments
Open

webpack example #33

creimers opened this issue Mar 2, 2016 · 8 comments
Labels
Milestone

Comments

@creimers
Copy link

creimers commented Mar 2, 2016

Hi,

thanks for this package, we've been using it a lot.

I am currently refactoring a project switching dependency management to webpack.

I see there's a whole lot of webpacking going on in the dist.

However, I cannot get this to work with require('angular-formly-material') using the latest release (0.14.1).

Error: [$injector:modulerr] Failed to instantiate module {"default":"formlyMaterial"} due to:
Error: [ng:areq] Argument 'module' is not a function, got Object

Can you help me out here and provide webpack usage instructions? Thank you.

@plitzenberger
Copy link

+1

@kamilkisiela
Copy link
Collaborator

Thanks, I'm going to check it

@kamilkisiela kamilkisiela added this to the v1.0.0 milestone Mar 2, 2016
@creimers
Copy link
Author

creimers commented Mar 2, 2016

Thanks for looking into this. Any more info I can provide?

@kamilkisiela
Copy link
Collaborator

@creimers I think that formlyMaterial is not commonjs compatible at the moment but I have to investigate it.

If you're using it like this:

angular.module('app', [
    require('angular-formly-material')
]);

I believe that require('angular-formly-material').default will work for you.

angular.module('app', [
    require('angular-formly-material').default
]);

@creimers
Copy link
Author

creimers commented Mar 2, 2016

@kamilkisiela You are very right. Thank you! Dobranoc.

@creimers creimers closed this as completed Mar 2, 2016
@kamilkisiela
Copy link
Collaborator

@kamilkisiela You are very right. Thank you! Dobranoc.

That's nice! 💤 Gute Nacht

I'm going to keep it open to be aware of that commonjs issue

@kamilkisiela kamilkisiela reopened this Mar 2, 2016
@rigobcastro
Copy link

This works for me:

import angular from 'angular';
import formly from 'angular-formly';
import formlyMaterial from 'angular-formly-material';

angular.module('app', [
    formly,
    formlyMaterial
]);

@mmospanenko
Copy link

VM17006 angular.js:68Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to: Error: [$injector:modulerr] Failed to instantiate module formlyMaterial due to: Error: [$injector:modulerr] Failed to instantiate module ngMessages due to: Error: [$injector:nomod] Module 'ngMessages' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

It had worked after I installed angular-message:

import angularMessages from 'angular-messages';

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants