serah
serah

Reputation: 2117

why is console.log is giving an error that is not a function type?

I am suddenly getting the below error . I havent changed anything in this controller recently to get this error.

Has anyone seen a similar issue before or know how to fix this? My browsers havent changed or updated, and it was working fine until yesterday.

Chrome TypeError: console.log is not a function

IE TypeError: Function expected

 CreateBankCtrl.$inject = ['CommonService'];

  function CreateBankCtrl(CommonService) {
        var vm = this;
        vm.apiAlerts = [];
        console.log("Creating the controller");
}

Upvotes: 1

Views: 4550

Answers (2)

serah
serah

Reputation: 2117

Finally, I found the issue,

I had inadvertently introduced an equals to operation ("=")

console.log = ("fetched user permissions " + $localStorage.userPermissions);

this had overridden the log function. I have lint setup with strict mode on. But the above was not caught. Can lint be configured to capture such issues?

Upvotes: 1

Santosh Sapkota
Santosh Sapkota

Reputation: 140

It could be your browser, or some cache, try to clear it and open fresh browser. It works for me. I hope this will help you out.

Upvotes: 0

Related Questions