EmberJS - Services
Service is an Ember object which can be made available in the different parts of the application.
Services can be used in different kinds of areas −
- Geolocation
- Third-party APIs
- Events or notifications sent by server
- User or session authentication
- Logging
- WebSockets
You can create the service by using the following command −
ember generate service service-name
When you run the above command, it will display the following code format −
import Ember from 'ember';
//services must extend the Ember.Service base class
export default Ember.Service.extend ({
});
For more about services along with an example, see this link.
emberjs_application_concerns.htm
Advertisements