Hello everyone,

In my html : 
 <h1 ng-click="changeName()">{{$ctrl.employees[0].name}}</h1>


In my .js :
module.exports = {
  template: require('./employee.html'),
  controller: EmployeeController
};

/** @ngInject */
function EmployeeController() {
   this.employees = [{
          name: 'Agnes',
          superpower: 'Java Champion',
          skills: ['Java', 'JavaEE', 'BDD'],
          access: true
        }, {
          name: 'JB',
          superpower: 'Stack Overflow Superstar',
          skills: ['Java', 'Javascript', 'Gradle'],
          access: false
        }, {
          name: 'Cyril',
          superpower: 'VAT specialist' /*I'm joking buddy*/ ,
          skills: ['Java', 'Play!'],
          access: true
        }, {
          name: 'Cedric',
          superpower: 'Hype developper',
          skills: ['Java', 'Javascript', 'Git'],
          access: true
        }];
}

 this.changeName = function() {
        alert("hi?")
        this.employees[0].name = "Nelly";
}


I think that i don't really anderstand how to connect a function in a 
controller with a ngclick in the view... Can someone explain me a bit why 
what i did does not work ? 

Another question. What is the best way to create an application with a BDD 
of employees ( with different role, so different access of parts of the 
application ). Should i add a value in each employee that define his access 
and then open parts of the application allowed with that value ?

SOrry for my bad english :s

Thank you all

-- 
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