Atsuhiro Teshima
Atsuhiro Teshima

Reputation: 1508

Ember.js: Which one should I choose between Namespace, Service, and Util?

I'm now working on Ember CLI application. Now checking the strategy for implementing Authentication.

Now, I plan to create Auth.js, which would maintain the login state and can perform actions.

For example, in Balanced-dashboard, they are using "Namespace", but Travis-CI put it in Util folder.

I also feel like Ember.Service is appropriate for putting Auth.js.

It seems both Namespace and Service are kind of Alias of Ember Object. So, I'm wondering which of them to choose.

What kind of rule I should apply?

Upvotes: 0

Views: 111

Answers (1)

Pedro
Pedro

Reputation: 3781

I actually just answered a similar question there. Long story short: don't waste your time and use ember-simple-auth, you will save hours of work :) It is a very flexible library that can handle different authentication/authorization mechanisms in parallel and across different tabs of the browser.

Otherwise yes, Ember services are the way to go!

Upvotes: 1

Related Questions