{"id":20314304,"url":"https://github.com/normandy72/routing-state-with-url","last_synced_at":"2026-04-12T02:36:35.315Z","repository":{"id":153902848,"uuid":"592028608","full_name":"Normandy72/Routing-State-with-URL","owner":"Normandy72","description":"Routing State with URL Parameters. Coursera course \"Single Page Web Applications with AngularJS\" by Yaakov Chaikin.","archived":false,"fork":false,"pushed_at":"2023-01-22T18:21:02.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T11:38:25.239Z","etag":null,"topics":["angular","angularjs","css","css3","html","html5","javascript","js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Normandy72.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-22T17:52:55.000Z","updated_at":"2023-01-22T18:06:11.000Z","dependencies_parsed_at":"2023-05-06T16:46:25.862Z","dependency_job_id":null,"html_url":"https://github.com/Normandy72/Routing-State-with-URL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Normandy72/Routing-State-with-URL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FRouting-State-with-URL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FRouting-State-with-URL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FRouting-State-with-URL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FRouting-State-with-URL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Normandy72","download_url":"https://codeload.github.com/Normandy72/Routing-State-with-URL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Normandy72%2FRouting-State-with-URL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31702580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"online","status_checked_at":"2026-04-12T02:00:06.763Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["angular","angularjs","css","css3","html","html5","javascript","js"],"created_at":"2024-11-14T18:14:41.953Z","updated_at":"2026-04-12T02:36:35.271Z","avatar_url":"https://github.com/Normandy72.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Routing State with URL Parameters\n### Step 1: Set up URL Property With Param(s)\n```\n.state('view1', {\n    url: '/view1/{param1}',\n    templateUrl: 'view1.html',\n    controller: 'View1Ctrl as view1',\n    resolve: {\n        myData: ['$stateParams', function($stateParams){\n            return getDataBasedOn($stateParams.param1);\n        }]\n    }\n});\n```\n### Step 2: Inject Resolve Property Into Controller\n```\nView1Ctrl.$inject = ['myData'];\nfunction View1Ctrl(myData){\n    var view1 = this;\n    view1.myData = myData;\n}\n```\n\n```\n\u003ca ui-sref=\"view1({itemId:someVal})\"\u003e\n    Link to view with data\n\u003c/a\u003e\n```\n`view1` - state name\n\n`{itemId:someVal}` - param name/value pairs\n\n***\n#### _Summary_\n* State's URL property can be declared with parameters.\n* Parameters:\n    * wrapped in curly braces (`{paramName}`);\n    * can have more complex matching rules other than just a string;\n    * support regular expression matching.\n* Use `$stateParams` service to retrieve parameters (`$stateParams.paramName`).\n* Construct a URL with ui-sref directive: `ui-sref=\"stateName({paramName:value})\"`\n***","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Frouting-state-with-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormandy72%2Frouting-state-with-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormandy72%2Frouting-state-with-url/lists"}