{"id":21656992,"url":"https://github.com/cotag/ngroutenames","last_synced_at":"2026-02-26T12:02:15.657Z","repository":{"id":9765376,"uuid":"11734047","full_name":"cotag/ngRouteNames","owner":"cotag","description":"AngularJS Named Routes","archived":false,"fork":false,"pushed_at":"2015-10-04T22:50:24.000Z","size":210,"stargazers_count":17,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-02-06T19:37:36.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cotag.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-29T07:48:01.000Z","updated_at":"2015-10-21T20:16:11.000Z","dependencies_parsed_at":"2022-09-06T03:22:01.207Z","dependency_job_id":null,"html_url":"https://github.com/cotag/ngRouteNames","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/cotag/ngRouteNames","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FngRouteNames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FngRouteNames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FngRouteNames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FngRouteNames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cotag","download_url":"https://codeload.github.com/cotag/ngRouteNames/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2FngRouteNames/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29858461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T08:51:08.701Z","status":"ssl_error","status_checked_at":"2026-02-26T08:50:19.607Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T09:18:40.526Z","updated_at":"2026-02-26T12:02:15.629Z","avatar_url":"https://github.com/cotag.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. ngRouteNames\n\n- AngularJS Named Routes !https://travis-ci.org/cotag/ngRouteNames-tests.png?branch=master!:https://travis-ci.org/cotag/ngRouteNames-tests\n\nA route provider and ng-href add-on for advanced routing and mobile device support\nThe @goto@ directive depends on \"Angular Gesture\":https://github.com/cotag/bower-angular-gesture so the links are responsive on all mobile devices\n\nh3. Installing\n\n# Open bower.json or components.json\n# Add @\"ngRouteNames\": \"~1.1.1\"@ to your dependency list\n# Run @bower install@\n# In your application you can now add: (depending on what you need)\n#* @\u003cscript src=\"components/ngRouteNames/ngRouteNames.js\"\u003e\u003c/script\u003e@\n#* @\u003cscript src=\"components/ngRouteNames/directive/goto.js\"\u003e\u003c/script\u003e@\n\n\nh2. Defining Routes\n\nRoutes are defined in the same way as regluar AngularJS routes with the following differences:\n\n# Use of @$routeNamesProvider@ in replacement of @$routeProvider@\n# Supplying a name for the route\n# Provides a promise that is resolved once navigation is complete\n\n\nExample 1:\n\n\u003cpre lang=\"javascript\"\u003e\u003ccode\u003e\nangular.module('ExampleApp', ['ngRouteNames'])\n\n.config(['$routeNamesProvider', '$locationProvider', function ($routeProvider) {\n\n  $routeProvider\n    .when('/', {\n      templateUrl: 'views/view1.html',\n      name: 'home'\n    })\n    .when('/view2', {\n      templateUrl: 'views/view2.html',\n      name: 'view2'\n    })\n    .when('/:user/view3', {\n      templateUrl: 'views/view3.html',\n      name: 'view3'\n    })\n    .when('/:user/view4', {\n      templateUrl: 'views/view4.html',\n      name: 'view4'\n    })\n    .otherwise({\n      redirectTo: '/'\n    });\n\n    $routeProvider.activeClass = 'is-active';\t// This is the default\n\n}]).\n\ncontroller('SomeCtrl', ['$scope', '$route', '$http', function ($scope, $route, $http) {\n\t$scope.funcToCall = function() {\n\t\t// Simple:\n\t\t$route.to.view4();\n\n\t\t// defining params and search params (both optional)\n\t\t$route.to.view4({\n\t\t\t\tuser: 'steve'\n\t\t\t},\n\t\t\t{\n\t\t\t\tusing: 'search',\n\t\t\t\tparams: 'is optional too'\n\t\t});\n\n        // Promises:\n        $route.to.view4().then(function() {\n            // Update elements on the page or trigger functions.\n            // Great for things like using HTML5 fullscreen where\n            // Updating the route after making an element\n            // fullscreen will cause fullscreen to exit.\n        });\n\t};\n}]);\n\n\u003c/code\u003e\u003c/pre\u003e\n\n\nh2. Defining links in the view:\n\n* Links are defined using the @goto@ directive and should be used instead of @ng-href@.\n* They are not limited to use on @\u003cdiv goto=\"route-name\"\u003elink tags\u003c/div\u003e@\n* Use attributes to define route parameters for @\u003ca goto=\"route-name\" param1=\"somedata\" param2=\"more\"\u003eSpecific links\u003c/a\u003e@\n\nExample 2 (using the routes from example 1):\n\n\u003cpre lang=\"html\"\u003e\u003ccode\u003e\n\u003cimg src=\"logo.jpg\" goto=\"home\" /\u003e\n\u003cnav\u003e\n\t\u003cul\u003e\n\t\t\u003cli\u003e\u003ca goto=\"view2\"\u003eView2\u003c/a\u003e\u003c/li\u003e\n\t\t\u003cli\u003e\u003ca goto=\"view3\" user=\"steve\"\u003eView3\u003c/a\u003e\u003c/li\u003e\n\t\t\u003cli\u003e\u003ca goto=\"view4\"\u003eView4\u003c/a\u003e\u003c/li\u003e \u003c!-- will use existing user param if defined in the current url --\u003e\n\t\u003c/ul\u003e\n\u003c/nav\u003e\n\n\u003c/code\u003e\u003c/pre\u003e\n\n\nh2. Highlighting any active links\n\n* @'is-active'@ is defined as the default active class.\n** The first example indicates how you can change this\n** Any link defined with @goto@ will have this class when the current url matches.\n* Links defined with @goto@ will have the route name added as a class\n\nNote: If you are looking to highlight a higher dom element such as the @li@ elements in example 2 you can do the following:\n\n\u003cpre lang=\"html\"\u003e\u003ccode\u003e\n\u003cnav\u003e\n\t\u003cul\u003e\n\t\t\u003c!-- apply the class 'active' when the route name matches --\u003e\n\t\t\u003cli ng-class=\"{active: $route.current.name === 'view2'}\"\u003e\n\t\t\t\u003ca goto=\"view2\"\u003eView2\u003c/a\u003e\n\t\t\u003c/li\u003e\n\t\u003c/ul\u003e\n\u003c/nav\u003e\n\n\u003c/code\u003e\u003c/pre\u003e\n\n\nh2. Adding search params\n\n*Experimental - issues / feedback welcome*\n\nA param named @search@ is reserved for defining search params. This param is $parsed so it must be valid javascript returning a string or object that will be used as the search parameters\n\nExamples:\n\n* @\u003ca goto=\"search\" search=\"{param1:'somedata', param2:'more data'}\"\u003e\u003c/a\u003e@ as an object\n* @\u003ca goto=\"search\" search=\"'param1=somedata\u0026param2=more data'\"\u003e\u003c/a\u003e@ as a string\n* @\u003ca goto=\"search\" search=\"someFunction();\"\u003e\u003c/a\u003e@ as a function call\n* @\u003ca goto=\"search\" search=\"true\"\u003e\u003c/a\u003e@ maintain any existing search params\n\nNote: the context for the search parameter is the current @$scope@ when using @goto@\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fngroutenames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcotag%2Fngroutenames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fngroutenames/lists"}