Hi Akshaya,

Have a read through the style-guide 
<https://github.com/johnpapa/angular-styleguide>! It will help you to 
answer this question.

You should avoid using $scope to begin with. If you need temporary helper 
variables to aid your view, your way is the correct way to do it.
function ChallengeDetailsController() {
   this.test = 'Hello'
}

angular
  .module('myApp')
  .controller('challengeDetailsController`,ChallengeDetailsController);

If you have real data, this should live in a service you can inject 
wherever you need it. 
Also, make a ChallengeDetails component instead of using a ngController.

If you have more questions, don't hesitate to ask.
Regards
Sander

-- 
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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to