Tuesday, March 04, 2014

"TypeError: Object has no method 'match'" using angularJs

I was getting the following error:

TypeError: Object 4 has no method 'match'

In some angular code I have written.
took some time to debug but it turns out the isolated scope of one of my directives had a property that was not a string. somewhere inside angular it seems that it is expected that the properties of the isolated scope would all be strings and thus have a .match method....

so
   .directive('myDirective',
      function() {
return {
restrict: "E",
replace: false,
scope: {
        x:4,
},


resulted in the said error.

just so that you will know...

 
Clicky Web Analytics