Questions tagged [ui-sref]
127 questions
12
votes
1 answer
Definition of ui-sref in Angular.js?
I've been having some trouble getting a decent explanation of what ui-sref is actually doing in angular.
In HTML href is hyperlink reference, so does sref mean script reference?

Ben Casalino
- 2,262
- 5
- 20
- 28
12
votes
2 answers
Site navigation using ui-sref, how to remove ui-sref attribute when not available
I've setup navigation as follows, using ng-repeat, which works very well
{{link.Text}}
However, my navigation items…

mrb398
- 1,277
- 4
- 24
- 32
10
votes
2 answers
angular ui.router ui-sref replace url characters - beautify
I'm searching for a possibility to replace characters in the ui-sref, respecting the URL of a target.
.state('base.product.detail', {
url: 'detail/:productName-:productId/'
The URLs now look like:
Now:…

Markus
- 1,069
- 8
- 26
9
votes
2 answers
ui-router: open state in new tab with target="_blank", params are lost
I'm doing an Angular app in which a table's rows has a button each, and on click of these buttons a new tab should be opened for the row that button is on.
I needed to pass parameters into the new tab created this way. I've declared the parameter in…

Ralph Sto. Domingo
- 398
- 1
- 2
- 13
6
votes
1 answer
"base href" adds directory path in routing urls using ui-router
Summary :
When using , it adds the directory path in routing urls e.x. http://www.example.com/prod/public/home
My angular app is hosted in the prod/public directory.
in my public/index.html:

Debug Diva
- 26,058
- 13
- 70
- 123
6
votes
1 answer
$stateParams converting value to string
I am using UI-Router. Here's one of my state to which I am routing via ui-sref:
.state("community", {
url: "/community/:community_id",
controller: "CommunityCtrl",
templateUrl: "/static/templates/community.html"
})
In one of my…

Tarun Dugar
- 8,921
- 8
- 42
- 79
5
votes
3 answers
5
votes
2 answers
ui-sref not working when generate dynamic content for datatable columns
I'd to link a column of my data-table to a dynamic Angularjs view.
Table 1 :
ID | Name | Action
1 | Jack | Edit
Edit should be a link to #/clients/1/edit
/clients/:id/edit (app.client_edit) is already created and it's working.
I'm trying the…

Abbas Moazzami
- 441
- 5
- 17
4
votes
1 answer
AngularJS ui-router: ui-sref links aren't prepending the hash when filling in href values
My ui-router state provider is setup like so:
.state(
'events', {
url: '/events',
templateUrl: ...,
controller: ...
})
.state(
'events.listEvents', {
url: '/list',
templateUrl: ...,
…

Dasmowenator
- 5,505
- 5
- 36
- 50
4
votes
1 answer
How to access state params (ui-sref) without including them in URL propery of state in angularjs
This question is might be similar to this but with different requirements. As I was not able to make comment (required 50 points) I am replicating the question.
I want to simply access the parameters sent from ui-sref in template inside the…

Sohail Faruqui
- 442
- 11
- 27
3
votes
0 answers
Relationship between parent and child state in angularjs
I have a problem that is about parent state and child state.I have a button.When i click the button it opens a modal(state:context.form).It is okey but i have another state which is called new(new state is child of context.form state).What i want to…

Belhanda
- 135
- 1
- 8
3
votes
2 answers
Passing data attributes with ui-sref
I want pass some extra data into the controller from ui-sref. I am looping a json object and adding data to the sref:

Noobish
- 1,107
- 1
- 14
- 23
3
votes
1 answer
Activate specific tab after state change in angular
I have a web app built in AngularJS where I use $state to navigate through my different views. I'm also using several AngularUI Bootstrap components and styling, among other Bootstrap tabs.
Now what I was wondering about is if there was some way to,…

Backer
- 1,094
- 1
- 20
- 33
3
votes
1 answer
ui-sref-opts={reload: true} not reloading the controller
I have a link where I want to use a ui-sref. Even if the target is the same as the source I want it to reload.
For this reason I am using: ui-sref='newState' ui-sref-opts='{reload: true}'
But this does not work...
If I use: $state.go('newState', {},…

Matze Möller
- 31
- 5
3
votes
2 answers
Insert html into div with angular keeping ui-router ui-sref property working
Here is my case:
I have a div which needs to get some html injected from a function:
in my controller I have:
this.getMyLink = function () {
return 'my link';
}
It…

Leo
- 5,363
- 5
- 27
- 30