0

We have created one application with two html page and two ng-app one for admin and one for user side. I wanted single login authentication to work on both. Is that possible in AngularJS?

I have used toekn authentication with owin. http://bitoftech.net/2014/06/09/angularjs-token-authentication-using-asp-net-web-api-2-owin-asp-net-identity/comment-page-4/#comment-140050

Tushar Maru
  • 3,347
  • 10
  • 34
  • 53

1 Answers1

0

Yes. It does work. Refer below links:

AngularJS Multiple ng-app within a page

Multiplw ngApp within a Page

And, for the services, you can create Factory by following MVC pattern and inject the service in the dependency injection for your module or controller.

Monkey D. Luffy
  • 181
  • 1
  • 3
  • 16
  • Thanks for your reply. As I said I have two html page one for admin side and another for users side and both have the ng-app separate and I want to add login authentication, will login work? – Tushar Maru Feb 06 '19 at 14:21
  • Yes. It will. Just you need to inject Services or factory that you are using properly. – Monkey D. Luffy Feb 06 '19 at 14:36
  • I don't want both in single page as there are lots of different views will load on those both the pages. – Tushar Maru Feb 06 '19 at 14:46
  • Yeah. You could do that. Create a separate page with separate ng-app. The in app.js or whatever you're naming it, inject a module for both HTML templates in that file. That'll solve your query. – Monkey D. Luffy Feb 06 '19 at 15:03