Last active
December 8, 2015 08:47
-
-
Save mort3za/34da17b25d97d80d5965 to your computer and use it in GitHub Desktop.
Optional parameters in Angular UI Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// needs ui router 0.2.12+ | |
// ... | |
var Product: { | |
url: '^/p/:productId/{productAlias}', | |
params: { | |
productAlias: {value: null, squash: true} | |
} | |
} | |
.state('product', Product); | |
// ... | |
// This is the results: | |
// http://example.com/p/12 | |
// http://example.com/p/12/some-product-alias |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment