Ok so I'm currently trying to create a registration process following a MEAN stack tutorial and I've started using ()=>{} functions over the old syntax.
Now when I used the old syntax as follows
.controller('regCtrl', function(){
this.regUser = function(){
console.log('testing');
};
});
The code runs fine and doesn't throw me any errors in the console however when I use the new function syntax
.controller('regCtrl', ()=>{
this.regUser = ()=>{
console.log('testing');
};
});
I receive this in the console log
angular.js:14700 TypeError: Function.prototype.bind.apply(...) is not a constructor
at Object.instantiate (angular.js:5055)
at angular.js:11015
at Object.link (angular-route.js:1214)
at angular.js:1385
at wa (angular.js:10545)
at q (angular.js:9934)
at f (angular.js:9174)
at angular.js:9039
at angular.js:9430
at d (angular.js:9217) "<h2 ng-view="" class="ng-scope">"
I'm can only assume that this an issue that is within angularjs or that I've syntaxed incorrectly however I am unable to see the issue.
My apologies if this seems like rookie mistake I'm quite an inexperienced coder.