Angularjs ui-router. How to redirect to login page

The point is, do not redirect if not needed === if already redirected to intended state. There is a working plunker with similar solution .run(function($rootScope, $location, $state, authenticationSvc) { $rootScope.$on( ‘$stateChangeStart’, function(e, toState , toParams , fromState, fromParams) { var isLogin = toState.name === “login”; if(isLogin){ return; // no need to redirect } // now, … Read more

How to manually add a path to be resolved in eslintrc

I think the link below helps you. You can add resolving directories by using config. https://github.com/benmosher/eslint-plugin-import#resolvers For example, if you want to resolve src/, you can write like below on .eslintrc. { “settings”: { “import/resolver”: { “node”: { “paths”: [“src”] } } } } Then ESLint resolve from src directory. You can require src/hoge/moge.js by … Read more

error TS2794: Expected 1 arguments, but got 0. Did you forget to include ‘void’ in your type argument to ‘Promise’?

The standard argument for resolve in your case is unknown, which means that an argument is required; If you don’t want resolve to be taking any arguments you can explicitly set the generic type of Promise to void; return new Promise<void>((resolve, reject) => { this.red.SET(addr, resp, () => resolve()) })

WGET can’t resolve host

Check your /etc/nsswitch.conf file (or whatever the equivalent is on Debian if it’s not that). host and nslookup always do DNS lookups. However other applications will look in NSS first for other naming systems (e.g. /etc/hosts, NIS, etc). If something else is configured but not working it could prevent the application from ever trying the … Read more

Git resolve conflict using –ours/–theirs for all files

Just grep through the working directory and send the output through the xargs command: grep -lr ‘<<<<<<<‘ . | xargs git checkout –ours or grep -lr ‘<<<<<<<‘ . | xargs git checkout –theirs How this works: grep will search through every file in the current directory (the .) and subdirectories recursively (the -r flag) looking … Read more