
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
angular-promise-router
Advanced tools
This is an extension of the router provided by angular (ngRoute).
Its named as 'qRoute' named after $q of angularJS.
Reason for extending the ngRoute is to keep the route config manage the page flow. For page flows in controller today we use $location.url(). This is not a good design to have route URL's spread across the entire controller code base.
qRoute provides an alternative where the page flow is handled in the route configuration with the help of outcomes.
The below example should give a fair idea about how to use the module
angular.module('app', ['qRoute']).controller('myController', function($scope,$controller) {
});
angular.module('app').config(['$routeProvider',function($routeProvider){
$routeProvider.when('/',{
templateUrl : '/home.html',
controller : 'HomeCtrl',
// OUTCOMES mapped here
//
on : {
'loginOK':'/dashboard'
}
})
.when('/dashboard',{
templateUrl : '/dashboard.html',
controller : 'DashboardCtrl',
on : {
'logout':'/'
}
});
}]);
angular.module('app').controller('HomeCtrl', function($scope,$done,$timeout) {
console.log("in Home Contoller");
$scope.login = function(){
$done('loginOK');
}
});
angular.module('app').controller('DashboardCtrl', function($scope,$done,$timeout) {
console.log("in Dashboard Contoller");
$scope.logout = function(){
$done('logout');
}
});
FAQs
Promise based router for angularjs
The npm package angular-promise-router receives a total of 0 weekly downloads. As such, angular-promise-router popularity was classified as not popular.
We found that angular-promise-router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.