by
0 7
3
4
6,647
13
Top 1% !
Popular
Pearl of Wisdom
Specified
Popularity: 972nd place
This snippet is Public
No tags for this snippet yet.
LanguageCoffeeScript
LicenseMIT_X11
SourceGitHub

Global Resolve for Angular ngRoute

Global Resolve for Angular ngRoute: 
routes.coffee
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/128920/Global-Resolve-for-Angular-ngRoute?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
'use strict'; angular.module('app.routes') .config(['$routeProvider', ($routeProvider) -> angular.extend({}, $routeProvider, { orgWhen: (path, route) -> route.resolve ||= {} route.resolve = _.merge(route.resolve, { chef: 'OrganizationCheckerProvider' }) $routeProvider.when.call(this, path, route) }) # Organizations .when('/organizations', { templateUrl: '/templates/organizations/index.html', controller: 'OrganizationsCtrl', controllerAs: 'orgs', }) .when('/organizations/new', { templateUrl: '/templates/organizations/new.html', controller: 'OrganizationsNewCtrl', controllerAs: 'org', }) .orgWhen('/organizations/:organizationId', { templateUrl: '/templates/organizations/show.html', controller: 'OrganizationsShowCtrl', controllerAs: 'org', }) .orgWhen('/organizations/:organizationId/edit', { templateUrl: '/templates/organizations/edit.html', controller: 'OrganizationsEditCtrl', controllerAs: 'org', }) ])
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus