navalsaini
navalsaini

Reputation: 522

Override the System package in mean.io

Q1) I need help with overriding System package in mean.io? I am trying to create my own home page.

So I did this

angular.module('mean.mysystem', ['mean.system'])
  .config(['$viewPathProvider',
   function($viewPathProvider) {
    $viewPathProvider.override('system/views/index.html', 'mysystem/views/index.html');
   }
]);

I get following error http://errors.angularjs.org/1.3.2/ng/areq?p0=MysystemController&p1=not+aNaNunction%2C+got+undefined

Can anyone suggest a resolution or a better way to do this?

Q2) Also, is this the right way to extend a package

Mysystem.register(function(app, auth, database, System) {

Does mean know the package to extend from a variable name?

Upvotes: 0

Views: 857

Answers (2)

mSzafarski
mSzafarski

Reputation: 1

You can just add:

$stateProvider
      .state('/', {
        url: '/',
        templateUrl: 'youPackage/views/index.html'
      });

into your routes file.

$viewPathProvider not exist in older version of mean.io, for example in this used by openshift quickstart.

Upvotes: 0

Sharphill
Sharphill

Reputation: 41

Don't know why, but removing the ['mean.system'] worked for me. Something as below,

angular.module('mean.mysystem')
  .config(['$viewPathProvider',
   function($viewPathProvider) {
    $viewPathProvider.override('system/views/index.html', 'mysystem/views/index.html');
   }
]);

This might be the why: "angular.module('mean.mysystem', ['mean.system'])" creates a new module which probably is in conflict with the one MEAN creates during package registration.

Upvotes: 4

Related Questions