Toast throws error when raised
I'm invoking a toast like this
var hideToast = $materialToast({
template: '
' + toastMessage +'
But when the toast is raised, it throws an error "ReferenceError: Hammer is not defined" in angular-material/angular-material.js:4052:28
Also, when trying to destroy the toast, it raises another error "Cannot read property 'destroy' of undefined" at "angular-material/angular-material.js:4071:19"
I'm using AngularJS v1.3.0-rc.3 and Angular Material v0.0.3. Am I missing something here?
Looks like Hammer isn't defined. Have you run bower install? Are you importing hammer.js either via script (src="bower_components/hammerjs/hammer.js") or via some sort of build tool?
Hey Ryan,
I've recently updated using bower update. That did not result in downloading hammer.js (should it be doing that?)
I've taken a look at the repo and they dont seem to be providing it.
Have you tried running bower install instead of bower update? If not, give that a try.
If it still doesn't work, try this from the root of your project directory and post the result
less bower_components/angular-material/bower.json
Hey Ryan,
It was just a lame mistake from my end. I didnt notice the hammerjs folder on the root of my bower_compnents. Included that in my list of deps and it worked. Thanks :)
@nikhildev glad you got it working but angular-material should have had it listed as a dependency, so it's a bit peculiar