From 110d793ee6591b139d390f49c642edc93326fe74 Mon Sep 17 00:00:00 2001 From: Kasper Lewau Date: Sun, 3 May 2015 01:45:40 +0200 Subject: [PATCH] feat(uiState): add ui-state directive Works much like ui-sref but with a slight difference in that it accepts named $scope properties to evaulate for a state ref. Closes #395 --- src/stateDirectives.js | 80 +++++++++++++++++++++++++++++++------ test/stateDirectivesSpec.js | 64 +++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 12 deletions(-) diff --git a/src/stateDirectives.js b/src/stateDirectives.js index 09991030c..ea1197361 100644 --- a/src/stateDirectives.js +++ b/src/stateDirectives.js @@ -24,17 +24,17 @@ function stateContext(el) { * @restrict A * * @description - * A directive that binds a link (`` tag) to a state. If the state has an associated - * URL, the directive will automatically generate & update the `href` attribute via - * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking - * the link will trigger a state transition with optional parameters. + * A directive that binds a link (`` tag) to a state. If the state has an associated + * URL, the directive will automatically generate & update the `href` attribute via + * the {@link ui.router.state.$state#methods_href $state.href()} method. Clicking + * the link will trigger a state transition with optional parameters. * - * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be + * Also middle-clicking, right-clicking, and ctrl-clicking on the link will be * handled natively by the browser. * - * You can also use relative state paths within ui-sref, just like the relative + * You can also use relative state paths within ui-sref, just like the relative * paths passed to `$state.go()`. You just need to be aware that the path is relative - * to the state that the link lives in, in other words the state that loaded the + * to the state that the link lives in, in other words the state that loaded the * template containing the link. * * You can specify options to pass to {@link ui.router.state.$state#go $state.go()} @@ -42,22 +42,22 @@ function stateContext(el) { * and `reload`. * * @example - * Here's an example of how you'd use ui-sref and how it would compile. If you have the + * Here's an example of how you'd use ui-sref and how it would compile. If you have the * following template: *
  * Home | About | Next page
- * 
+ *
  * 
  * 
- * + * * Then the compiled html would be (assuming Html5Mode is off and current state is contacts): *
  * Home | About | Next page
- * 
+ *
  *