Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ng-admin app inside another app? #335

Closed
SylvainBigonneau opened this issue Feb 27, 2015 · 4 comments
Closed

Using ng-admin app inside another app? #335

SylvainBigonneau opened this issue Feb 27, 2015 · 4 comments

Comments

@SylvainBigonneau
Copy link

I have built an angular app using ui-router, with 3 different abstract states for three different contexts:

  • A front-office, on the /route
  • A back-office for users, on the /account route
  • An administration panel, on the /admin route

I'm not too sure about running another app just for the admin that I would have to assign to the /admin route in my express server, so I was hoping I could just use ng-admin as a module and assign it to my /admin route within the app using ui-router or something else, but I see no documentation to support that it is feasible.

So... is it? Or am I a hopeless dreamer :(

@easel
Copy link
Contributor

easel commented Feb 27, 2015

I've been able to do this by selectively overriding the urls for MainModule and CrudModule in my require.js config. It's pretty ugly, but it works.

I've been meaning to ask the ng-admin folks how they would feel about namespacing the states and urls, it would make use-cases such as this much cleaner. "/dashboard" and "DashboardController", for instance, are very commonly used in other apps.

@anyong
Copy link

anyong commented Apr 13, 2015

Not sure exactly what you mean about overriding the urls easel, but this is something that I would really like to do too...

To the maintainers, ng-admin seems fantastic but I'd also like to be able to set my own route as the base route for ng-admin.

@drorm
Copy link

drorm commented Jan 28, 2016

So the following seems to work:

  • Make sure you're using ui-router and not angular-router in your app
  • include ng-admin as described in the documentation. Make sure to create a ui-view element.
  • To go to the ng-admin, don't use a route, use the url "/#/admin/dashboard" either via a href or using $location.path('admin/dashboard'); (notice the different syntax in the URL).

@drorm
Copy link

drorm commented Mar 5, 2016

Add the following CSS to hide the ng-admin navbar

.sidebar-nav {
    visibility: visible;
}

#header-nav {
    visibility: hidden;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants