i using angular ionic. i not want user have login again in case logged in , did not logout last time used application. reason, using local storage check if user logged in. tried putting code in run block. $rootscope.$on('$statechangestart', function (event, tostate, toparams, fromstate, fromparams) { if($localstorage.userinfo){ $state.go('deployment'); //this line 270 of app.js event.preventdefault(); return; } }) but gives error says: rangeerror: maximum call stack size exceeded @ scope.$broadcast (ionic.bundle.js:23414) @ object.transitionto (ionic.bundle.js:40804) @ object.go (ionic.bundle.js:40671) @ app.js:270 @ scope.$broadcast (ionic.bundle.js:23412) @ object.transitionto (ionic.bundle.js:40804) @ object.go (ionic.bundle.js:40671) @ app.js:270 @ scope.$broadcast (ionic.bundle.js:23412) @ object.transitionto (ionic.bundle.js:40804) also, error: [$rootscope...
i testing application in declare specific variable within constructor , assign return of function imported class. how code looks like: var someclass; function constructor() { this.someclasshandler = null; } constructor.prototype.newsomeclass = function() { someclass = require('./someclass.js'); return new someclass(); } constructor.prototype.getfunction = function() { this.someclasshandler = this.newsomeclass(); } constructor.prototype.callsomefunction = function() { this.someclasshandler.somefunction(); } when try test code whether function 'somefunction' imported class 'someclass' called within method'callsomefunction' receive failed test responses variable 'someclasshandler' still equals null (which makes sense not call method 'getfunction' assigns class variable). i use mocha , sinon tests, bit helpless whether mock or stub class in order assign variable 'this.someclasshandler' correctly. the m...
Comments
Post a Comment