Reputation: 1018
The meanjs core module provides a default index page for the home state:
// Home state routing
$stateProvider
.state('home', {
url: '/',
templateUrl: 'modules/core/client/views/home.client.view.html'
})
I have added my own module mymod
to the meanjs application. I would like to use my own partial modules/mymod/client/views/browse.client.view.html
.
How do I do it WITHOUT modifying the core.client.route.js
file? I always avoid modifying code obtained from frameworks and belive in overriding. What is the recommended approach to do this?
Upvotes: 1
Views: 114
Reputation: 2078
I think you are misunderstanding the point of MEANJS. From MEANJS github page:
MEAN.JS is a full-stack JavaScript open-source solution, which provides a solid starting point for MongoDB, Node.js, Express, and AngularJS based applications. The idea is to solve the common issues with connecting those frameworks, build a robust framework to support daily development needs, and help developers use better practices while working with popular JavaScript components.
MEANJS is not a strict platform that will stop working if you change its own code. Of course that there are some code blocks that should not be modified but there are blocks that you can/should modify to avoid clutter in your code as your app grows.
With that said, you can still keep the route as it is:
$stateProvider
.state('home', {
url: '/',
templateUrl: 'modules/core/client/views/home.client.view.html'
});
And in this partial modules/core/client/views/home.client.view.html
, you can use AngularJS directive ng-include and in the src
put the path for your custom partial browse.client.view.html
. This way you don't need to modify core.client.route.js
you just have to modify the partial modules/core/client/views/home.client.view.html
.
Upvotes: 4