Browse Source

feat: implement new LazyLoadService

pull/3469/head
mehmet-erim 7 years ago
parent
commit
9d8acf8550
  1. 20
      npm/ng-packs/apps/dev-app/src/app/app.component.ts
  2. 21
      templates/app/angular/src/app/app.component.ts

20
npm/ng-packs/apps/dev-app/src/app/app.component.ts

@ -1,5 +1,6 @@
import { LazyLoadService } from '@abp/ng.core';
import { LazyLoadService, LOADING_STRATEGY } from '@abp/ng.core';
import { Component, OnInit } from '@angular/core';
import { concat } from 'rxjs';
@Component({
selector: 'app-root',
@ -12,14 +13,13 @@ export class AppComponent implements OnInit {
constructor(private lazyLoadService: LazyLoadService) {}
ngOnInit() {
this.lazyLoadService
.load(
['fontawesome-all.min.css', 'fontawesome-v4-shims.min.css'],
'style',
null,
'head',
'afterbegin',
)
.subscribe();
concat(
this.lazyLoadService.load(
LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-all.min.css'),
),
this.lazyLoadService.load(
LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-v4-shims.min.css'),
),
).subscribe();
}
}

21
templates/app/angular/src/app/app.component.ts

@ -1,5 +1,6 @@
import { LazyLoadService } from '@abp/ng.core';
import { LazyLoadService, LOADING_STRATEGY } from '@abp/ng.core';
import { Component, OnInit } from '@angular/core';
import { concat } from 'rxjs';
@Component({
selector: 'app-root',
@ -10,15 +11,15 @@ import { Component, OnInit } from '@angular/core';
})
export class AppComponent implements OnInit {
constructor(private lazyLoadService: LazyLoadService) {}
async ngOnInit() {
this.lazyLoadService
.load(
['fontawesome-all.min.css', 'fontawesome-v4-shims.min.css'],
'style',
null,
'head',
'afterbegin'
ngOnInit() {
concat(
this.lazyLoadService.load(
LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-all.min.css')
),
this.lazyLoadService.load(
LOADING_STRATEGY.PrependAnonymousStyleToHead('fontawesome-v4-shims.min.css')
)
.subscribe();
).subscribe();
}
}

Loading…
Cancel
Save