I'm working on an already working website which was built using Smart Admin template.
I'm trying to add a component to the dashboard as a first step.
Here are the commands and steps I followed:
-Command line:
ng g module test --routing
cd test
ng g component test --flat
-Added in file app.routing.ts:
{path: 'test',loadChildren:'app/test/test.module#TestModule'}
-Added in file test-routing.module.ts:
import { TestComponent } from './test.component';
const routes: Routes = [
{
path:'',
component:TestComponent
}
];
-Added in file test-routing.module.ts
import { SmartadminModule } from '../shared/smartadmin.module';
and
SmartadminModule inside imports:[]
The test.component.html only contains:
<p>
test works!
</p>
When i call the page I'm getting the dashboard,header, footer... However in other modules in the project, the dashboard ... are included explicitly by adding :
<sa-header></sa-header>
<sa-navigation></sa-navigation>
<div id="main" role="main">
<sa-ribbon></sa-ribbon>
<router-outlet></router-outlet>
</div>
<sa-footer></sa-footer>
<sa-shortcut></sa-shortcut>
I hope someone can help me solve this problem.
Thank you
I suppose that the snippet with layout you provided is from
app.component.html. So you can change it a bit to look like this:And then have a
test.component.tslook like thisWhat I can't tell is how will this change affect other routes and if it's a desired behavior.
Might be better to keep the HTML as is and do a minor change in
app.component.tsAnd then you can change your
app.component.html