vendredi 30 juin 2017

'ApplicationRouteMix' is defined but never used [Ember.js]

I am creating an authentication to login to my app, but I am with these 3 problems and I do not know how to proceed, I am new to ember, I do not know much about how to fix problems, I am learning it yet, after I followed this process my app does not appear anymore the screen went blank only, the tutorial is that of ember-simple-auth: http://ift.tt/1HLYcPX - thank you in advance:

Could not start watchman
Visit http://ift.tt/2huy34z for more info.
Livereload server on http://localhost:49153
'instrument' is imported from external module 'ember-data/-debug' but 
never used

/home/carlos/www/vendasapi-frontend/app/controllers/login.js
4:31  error  'session' is not defined  no-undef

✖ 1 problem (1 error, 0 warnings)


/home/carlos/www/vendasapi-frontend/app/routes/application.js
2:8   error  'ApplicationRouteMix' is defined but never used  no-
unused-vars
5:35  error  'ApplicationRouteMixin' is not defined           no-undef

✖ 2 problems (2 errors, 0 warnings)


Build successful (4688ms) – Serving on http://localhost:4200/



Slowest Nodes (totalTime => 5% )              | Total (avg)         
----------------------------------------------+---------------------

Babel (20)                                    | 1481ms (74 ms)      
Rollup (1)                                    | 1352ms              
EslintValidationFilter (2)                    | 703ms (351 ms)      
Concat (8)                                    | 545ms (68 ms)       

app/controllers/login.js

import Ember from 'ember';

export default Ember.Controller.extend({
session: Ember.inject.service(session),

  actions: {
    authenticate() {
  let { identification, password } = 
this.getProperties('identification', 'password');

   this.get('session').authenticate('authenticator:oauth2', 
identification, password).catch((reason) => {
     this.set('errorMessage', reason.error);
      });

    }

  }

});

app/controllers/application.js

import Ember from 'ember';

export default Ember.Controller.extend({
  session: Ember.inject.service('session'),

   actions: {
     logout() {
      this.get('session').invalidate();
   }
 }
});

app/routes/application.js

import Ember from 'ember';
import ApplicationRouteMix from
'ember-simple-auth/mixins/application-route-mixin';

export default Ember.Route.extend(ApplicationRouteMixin);




Aucun commentaire:

Enregistrer un commentaire