1

I want to create a theming engine which would require me to override the system's state.provider pointing to it's view/index.html file. Is there a way I can reroute the home page without modifying the system's package?

When using the mean.io stack, do you just start modifying/adding to the /packages/system directory or create your own package, if so, how do you route to your package (making '/' go to your package) without rewritting the system package?

$urlRouterProvider.otherwise('/');
   // states for my app
   $stateProvider
      .state('home', {
       url: '/',
       templateUrl: 'system/views/index.html'
   });
 }
PrairieProf
  • 174
  • 11
Alexander Romero
  • 401
  • 5
  • 10

1 Answers1

2

Create a custom package and add this in the app.js register function code.

NewTheme.register(function(app, auth, database) {
    app.set('views',__dirname + '/server/views');

Then your custom package /server/views/index.html is used for your views.

BrettAHale
  • 791
  • 1
  • 5
  • 13
  • why `/server/views`? Surely `/public/views`, no? – Adam Marshall Nov 28 '14 at 19:54
  • @AdamMarshall Since that's where the layouts were, I left it there. I haven't tried to move them to the public directory - http://learn.mean.io/#mean-packages-overriding-the-default-layouts – BrettAHale Nov 29 '14 at 06:28
  • @BrettAHale but how would you go about attaching a controller, and possibly even lazy-loading required resources (for example using ocLazyLoad)? – Noy Aug 12 '15 at 07:29