Fix change detection in app component
This commit is contained in:
parent
e7eb5b3997
commit
f954b5da2a
|
@ -22,7 +22,7 @@
|
||||||
<my-menu></my-menu>
|
<my-menu></my-menu>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="main-col container-fluid" [ngClass]="getMainColClasses()">
|
<div class="main-col container-fluid" [ngClass]="{ expanded: isMenuDisplayed === false }">
|
||||||
|
|
||||||
<div class="main-row">
|
<div class="main-row">
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
|
|
@ -112,11 +112,4 @@ export class AppComponent implements OnInit {
|
||||||
window.scrollTo(0, 0)
|
window.scrollTo(0, 0)
|
||||||
this.isMenuDisplayed = !this.isMenuDisplayed
|
this.isMenuDisplayed = !this.isMenuDisplayed
|
||||||
}
|
}
|
||||||
|
|
||||||
getMainColClasses () {
|
|
||||||
// Take all width is the menu is not displayed
|
|
||||||
if (this.isMenuDisplayed === false) return [ 'expanded' ]
|
|
||||||
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ export class AuthService {
|
||||||
scope: 'upload',
|
scope: 'upload',
|
||||||
username,
|
username,
|
||||||
password
|
password
|
||||||
}
|
}
|
||||||
|
|
||||||
const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
|
const headers = new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded')
|
||||||
return this.http.post<UserLogin>(AuthService.BASE_TOKEN_URL, objectToUrlEncoded(body), { headers })
|
return this.http.post<UserLogin>(AuthService.BASE_TOKEN_URL, objectToUrlEncoded(body), { headers })
|
||||||
|
|
|
@ -98,7 +98,7 @@ function lineFeedToHtml (obj: object, keyToNormalize: string) {
|
||||||
|
|
||||||
// Try to cache a little bit window.innerWidth
|
// Try to cache a little bit window.innerWidth
|
||||||
let windowInnerWidth = window.innerWidth
|
let windowInnerWidth = window.innerWidth
|
||||||
setInterval(() => windowInnerWidth = window.innerWidth, 500)
|
// setInterval(() => windowInnerWidth = window.innerWidth, 500)
|
||||||
|
|
||||||
function isInSmallView () {
|
function isInSmallView () {
|
||||||
return windowInnerWidth < 600
|
return windowInnerWidth < 600
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
hmr: true,
|
hmr: true,
|
||||||
apiUrl: 'http://192.168.1.42:9000'
|
apiUrl: 'http://localhost:9000'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue