Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Having first control in the page with tabs to be focused
Message
De
30/11/2017 11:51:31
 
 
Information générale
Forum:
AngularJS
Catégorie:
Problèmes
Divers
Thread ID:
01655956
Message ID:
01655973
Vues:
23
>>Do you mean you tried the ng-focus directive in angularjs ?
>
>I didn't yet try ng-focus, let me try it. How should I use ng-focus to focus the first element?
>
>I tried using just focus="true" (for all controls in a loop) but this didn't work.

Don't think there's any such attribute. ng-focus takes an expression which evals to true/false. You could back that with a method that returns true when the relevant pane is selected.
Although, top of my head, I'm not sure how you should do that (I'm rapidly trying to forget AngularJs and focussing on Angular 2)

I think my problem is that I'm using nav-tabs. I found related discussion but it's a bit over my head
>
>https://stackoverflow.com/questions/24491779/set-focus-to-an-input-within-a-bootstrap-tabcontent-on-tab-change
>
>and I don't know how should I incorporate that in my own code.

Those are JQuery solutions (which should work)


>BTW, can you please also help with my other thread? When I left to sleep last night (I worked till 12 am) I realized my solution is not going to work in the case my message returns nothing and I do want the Save to fire. Right now it sort of works because I was testing with returning my error message.
>
>I am not sure how to get the logic to work, e.g. have my method that may call server call return its result and only after that fire the Save if it's OK.

What do you mean by 'message returns nothing' ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform