Dynamically set the value of ui-sref Angularjs

Looks like this is possible to do after all. A breadcrumb on GitHub by one of the ui-router authors led me to try the following: <a ng-href=”https://stackoverflow.com/questions/24349731/{{getLinkUrl()}}”>Dynamic Link</a> Then, in your controller: $scope.getLinkUrl = function(){ return $state.href(‘state-name’, {someParam: $scope.someValue}); }; Turns out, this works like a charm w/ changing scoped values and all. You can … Read more

What is the difference between “dismiss” a modal and “close” a modal in Angular UI-Bootstrap?

The answer is in the documentation, right after the two lines you quoted: The open method returns a modal instance, an object with the following properties: close(result) – a method that can be used to close a modal, passing a result dismiss(reason) – a method that can be used to dismiss a modal, passing a … Read more

How to detect current state within directive

Update: This answer was for a much older release of Ui-Router. For the more recent releases (0.2.5+), please use the helper directive ui-sref-active. Details here. Original Answer: Include the $state service in your controller. You can assign this service to a property on your scope. An example: $scope.$state = $state; Then to get the current … Read more

Can you override specific templates in AngularUI Bootstrap?

Yes, directives from http://angular-ui.github.io/bootstrap are highly customizable and it is easy to override one of the templates (and still rely on the default ones for other directives). It is enough to feed $templateCache, either feeding it directly (as done in the ui-bootstrap-tpls file) or – probably simpler – override a template using the <script> directive … Read more

angular ui-bootstrap typeahead callback on selectMatch?

There is better way of doing this now. A new callback method has been added In controller file add the following: $scope.onSelect = function ($item, $model, $label) { $scope.$item = $item; $scope.$model = $model; $scope.$label = $label; }; In view add the following: <input type=”text” ng-model=”selected” typeahead=”state for state in states | filter:$viewValue” typeahead-editable=”false” typeahead-on-select=”onSelect($item, … Read more

Difference between $state.transitionTo() and $state.go() in Angular ui-router

Are you referring to the AngularUI Router? If so, the wiki specifies the differences: $state.go(to [, toParams] [, options]) Returns a Promise representing the state of the transition. Convenience method for transitioning to a new state. $state.go calls $state.transitionTo internally but automatically sets options to { location: true, inherit: true, relative: $state.$current, notify: true }. … Read more