Search code examples
ember.jsember-simple-auth

What is the difference between SessionService and Ember.Service in ember 1.13?


I am new to ember and I am developing an app in ember 1.13 with a back end in Rails. I understand that the session and data store handling has changed from previous versions of ember quite a bit. I am using ember-simple-auth In particular, I am trying to recuperate data from an authenticated user and cannot get it. Documentation in the web uses both SessionService and Ember.Service but the difference is not clear to me. Can somebody help either with an explanation or with a link?


Solution

  • In ember you can create services same way you can create routes and controllers, it is class/paradigm that you use to build your application. You can create your own service by subclassing Ember.Service, if you have logic that needs to be shared across the app then it is good candidate for being a service. If you are using ember-cli you can generate service with ember g service <service-name>

    And SessionService is service that manages session provided/created by ember-simple-auth.

    ember guide services
    tutorial creating services