Comments (7)
I'm also experimenting with Angular 2 Materialize in Angular 2 Webpack Starter, and got the $overlay.velocity is not a function
error when trying to open a modal.
I got rid of the error by modifying the ProvidePlugin block:
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
"root.jQuery": "jquery",
Hammer: "hammerjs/hammer"
})
The two lines before Hammer: "hammerjs/hammer"
did the trick.
from angular2-materialize.
@vesteraas you rock!! This solved the problem in my tests.
I found that "root.jQuery" is not needed, so I'll just add the "window.jQuery" to the documentation.
@MurhafSousli please let us know if that solves it for you as well so we can close this issue.
from angular2-materialize.
Seems like it couldn't fine the angular2-materialize module in C:\Users\Murhaf\wamp64\www\murhaf\wp-content\themes\angular-murhaf\angular\node_modules\angular2-materialize\dist
Can you share the code (on Github or attach a zip of our C:\Users\Murhaf\wamp64\www\murhaf\wp-content\themes\angular-murhaf\angular) so I can take a look at?
from angular2-materialize.
@MurhafSousli I noticed that the distribution package had the "ts" files in it and with the webpack-starter it was loading them instead of the js files. I've released a new version without them and confirmed that it works with the angular2-webpack-starter project. Try to reinstall that one and see if that works for you.
If it still doesn't work for you, take a look at the https://github.com/InfomediaLtd/angular2-webpack-starter fork that is exactly like the regular angular2-webpack-starter with the addition of angular2-materialize,
Here's the relevant commit, adding angular2-materialize to the starter project: InfomediaLtd/angular2-webpack-starter@af82ae0
from angular2-materialize.
Thank you, now I have the same wepback.config.js
and the module worked, I tried
- modal example gave
Uncaught TypeError: $overlay.velocity is not a function
- hover example gave
Uncaught TypeError: newTooltip.velocity is not a function
here is the full code https://github.com/MurhafSousli/ng2-wordpress-theme
from angular2-materialize.
@MurhafSousli thanks for testing it and providing feedback.
I've updated the documentation on webpack configuration with missing provided libraries for MaterializeCSS:
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
Hammer: "hammerjs/hammer"
})
But, it's still complaining about the missing velocity function. Looking at the MaterializeCSS code I see that it's got a polyfill for velocity, but I can't understand why it works for JSPM and not for webpack.
When running the following in the browser console it works for JSPM , but not for webpack:
$().velocity
It means that the MaterializeCSS JS code that creates the velocity method on jQuery didn't work. It's the next 3 minified lines: https://github.com/Dogfalo/materialize/blob/master/dist/js/materialize.js#L232
When running it with webpack, the jQuery object doesn't have the Velocity method after running these three lines. Not sure why...
I've added a webpack configuration to the library so it's easy to run it internally and see the problem: https://github.com/InfomediaLtd/angular2-materialize
Maybe @Dogfalo can assist us here?
from angular2-materialize.
Thank you @rubyboy, you can close the issue
from angular2-materialize.
Related Issues (20)
- Callback function for onCloseEnd parameter is always being invoked HOT 1
- Project seems unmaintained HOT 3
- unable to use MzToastModule HOT 1
- How do I upgrade this to Angular 6? keep getting type definition error
- checkbox needs doubleclick to uncheck
- Carousel does not load data from service
- Using default html elements HOT 2
- Sidenav did not close
- Checkbox - indeterminate state HOT 1
- Uncaught Error: Template parse errors: Can't bind to 'materializeActions' since it isn't a known property of 'div'. HOT 1
- Uncaught Error: Couldn't find Materialize object on window HOT 13
- Javascript components are unstable
- Select from angular2-material does not work when loading data from an observable
- Datepicker and Select immediately closing on open HOT 21
- How to add carousel-item after http request
- When Router changes the page the materialize module.js stops working
- material_select multiple problem after reset
- want to use in angular 9
- how to use modal that can be reused in other components
- Don't open/show my modal, when I try to open, the modal doesn't show and the button doesn't any action. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-materialize.