I have been going through many links which states not to use services in angular views :
http://stackoverflow.com/questions/18377202/use-service-into-view-angular-js http://stackoverflow.com/questions/15039837/angularjs-is-this-way-of-using-service-good https://groups.google.com/forum/#!topic/angular/H6xROj3t1H0 I stumbled upon a code which used $stateParams directly in an angular view. As the view didn't have any forms and just needed to build a links according to the parameter passed in stateParams it does seemed ok to use it in view. The code is as below ..... <p> {{ 'FORGOT_PASSWORD.CONFIRMATION.CHECK_SPAM' | translate}} <a ui-sref="forgotPassword({email: $stateParams.email})"> {{'FORGOT_PASSWORD.CONFIRMATION.TRY_AGAIN' | translate}} </a>. </p> ..... In above I am just creating an anchor tag on the basis of the email passed as the query. Is it ok to directly use stateParams there ? Or should I define a variable on $scope and assign the parameter to that variable and then use the scope variable instead ? It doesn't seem worthwhile. -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
