I buy a theme that is working fine on an HTML + CSS simple project approach but I want to transform it into an Angular 6 project.
I managed to put the theme to work on Angular 6 with no problem, but I get a strange CSS behaviour when in an angular 6 application look my code :
<!-- begin:: Page -->
<div class="m-grid m-grid--hor m-grid--root m-page">
<m-header *ngIf="showContent"></m-header>
<!-- begin::Body -->
<div class="m-grid__item m-grid__item--fluid m-grid m-grid--ver-desktop m-grid--desktop m-body">
<m-leftmenu></m-leftmenu>
<div *ngIf="showContent" #mContentWrapper>
<router-outlet></router-outlet>
</div>
</div>
<m-footer></m-footer>
</div>
<!-- end:: Page -->
<!-- begin::Scroll Top -->
<div id="m_scroll_top" class="m-scroll-top">
<i class="la la-arrow-up"></i>
</div>
<!-- end::Scroll Top -->
this is my code from my PainelComponent ( painel.component.html ), I use a with a lazy load to load my HomeComponent inside the PainelComponent, this is the code from HomeComponent :
<div class="m-grid__item m-grid__item--fluid m-wrapper">
<!-- BEGIN: Subheader -->
<div class="m-subheader ">
<div class="d-flex align-items-center">
<div class="mr-auto">
<h3 class="m-subheader__title ">Painel</h3>
</div>
<div>
<span class="m-subheader__daterange" id="m_dashboard_daterangepicker">
<span class="m-subheader__daterange-label">
<span class="m-subheader__daterange-title"></span>
<span class="m-subheader__daterange-date m--font-brand"></span>
</span>
<a href="#" class="btn btn-sm btn-brand m-btn m-btn--icon m-btn--icon-only m-btn--custom m-btn--pill">
<i class="la la-angle-down"></i>
</a>
</span>
</div>
</div>
</div>
<!-- END: Subheader -->
<div class="m-content">
<!--Begin::Section-->
<div class="row">
<div class="col-xl-12">
</div>
<div class="col-xl-12 col-lg-12">
<!--begin:: Widgets/Quick Stats-->
<div class="row m-row--full-height">
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-brand ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
570
<small>All Sales</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_1"></canvas>
</div>
</div>
</div>
</div>
<div class="m--space-30"></div>
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-danger ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
690
<small>All Orders</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_2"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-success ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
230
<small>All Transactions</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_3"></canvas>
</div>
</div>
</div>
</div>
<div class="m--space-30"></div>
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-accent ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
470
<small>All Comissions</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_4"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
<!--end:: Widgets/Quick Stats-->
</div>
</div>
<!--End::Section-->
</div>
</div>
This is the approach that I DON'T WANT ( THIS IS IN ANGULAR 6 WITH ):
But when i pick all the code from HomeComponent, erase this line from PainelComponent :
<div *ngIf="showContent" #mContentWrapper>
<router-outlet></router-outlet>
</div>
and put all the code from HomeComponent it works as I expected with a Full-Width Wrapper 100%, Why this? What I must do to work with router, I was thinking that Angular just add the HTML file from a component but I guess is not like this.
This is the code when i put the home.component.html inside the painel.component.html
<!-- begin:: Page -->
<div class="m-grid m-grid--hor m-grid--root m-page">
<m-header *ngIf="showContent"></m-header>
<!-- begin::Body -->
<div class="m-grid__item m-grid__item--fluid m-grid m-grid--ver-desktop m-grid--desktop m-body">
<m-leftmenu></m-leftmenu>
<div class="m-grid__item m-grid__item--fluid m-wrapper">
<!-- BEGIN: Subheader -->
<div class="m-subheader ">
<div class="d-flex align-items-center">
<div class="mr-auto">
<h3 class="m-subheader__title ">Painel</h3>
</div>
<div>
<span class="m-subheader__daterange" id="m_dashboard_daterangepicker">
<span class="m-subheader__daterange-label">
<span class="m-subheader__daterange-title"></span>
<span class="m-subheader__daterange-date m--font-brand"></span>
</span>
<a href="#" class="btn btn-sm btn-brand m-btn m-btn--icon m-btn--icon-only m-btn--custom m-btn--pill">
<i class="la la-angle-down"></i>
</a>
</span>
</div>
</div>
</div>
<!-- END: Subheader -->
<div class="m-content">
<!--Begin::Section-->
<div class="row">
<div class="col-xl-12">
</div>
<div class="col-xl-12 col-lg-12">
<!--begin:: Widgets/Quick Stats-->
<div class="row m-row--full-height">
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-brand ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
570
<small>All Sales</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_1"></canvas>
</div>
</div>
</div>
</div>
<div class="m--space-30"></div>
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-danger ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
690
<small>All Orders</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_2"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-success ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
230
<small>All Transactions</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_3"></canvas>
</div>
</div>
</div>
</div>
<div class="m--space-30"></div>
<div class="m-portlet m-portlet--half-height m-portlet--border-bottom-accent ">
<div class="m-portlet__body">
<div class="m-widget26">
<div class="m-widget26__number">
470
<small>All Comissions</small>
</div>
<div class="m-widget26__chart" style="height:90px; width: 220px;">
<canvas id="m_chart_quick_stats_4"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
<!--end:: Widgets/Quick Stats-->
</div>
</div>
<!--End::Section-->
</div>
</div>
</div>
<m-footer></m-footer>
</div>
<!-- end:: Page -->
<!-- begin::Scroll Top -->
<div id="m_scroll_top" class="m-scroll-top">
<i class="la la-arrow-up"></i>
</div>
<!-- end::Scroll Top -->
This is the approach that I WANT: