2017  Kodetalk | Feedback | Privacy Policy | Terms | About

Trying to use angular growl plugin giving config not defined error and toLowerCase() method not defined

I am trying to integrate angularjs growl to my website and based on the documentation i did configure all. But when i am running the application it's giving error like config is undefined and if i am removing the config part i am getting exception like toLowerCase() method not found.

I am using angular plugin from this website : http://janstevens.github.io/angular-growl-2/

The code i have written for making this work as below:

var app = angular.module('newapp', ['angular-growl']);

  <div growl></div>

app.config(['growlProvider', function(growlProvider) {

// and 

app.controller('GCtrl', [ '$scope', '$http', 'growl',
		function($scope, $http, growl) {
			$scope.growlMessage = function() {
				growl.general("<b>I'm</b> a success message", {type: 'success', ttl: 4000}, 4000);
		} ]);

And if i am removing the config code i am keep getting error on browser like toLowerCase() method not defined.


Ok for your problem, what you can do is 1st remove the config method and do small change in the growl js file like before toLowerCase() add toString() method and will resolve your issue.

Answer is