13.0.2 • Published 6 months ago

ngx-source v13.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 months ago

ngx source

angular source, can load js and css in runtime

npm version GitHub issues GitHub stars GitHub license

Installation

Install through npm:

npm install --save ngx-source

use in one of your apps components:

import { Component, OnInit } from '@angular/core';
import { Source, SourceType, NgxSourceService } from 'ngx-source';

@Component({
  template: 'your-component',
})
export class YourComponent implements OnInit {
  constructor(private ngxSourceService: NgxSourceService) {
    this.ngxSourceService.addSources([
      new Source('yourJsName', '/js/yourJsFile.js', SourceType.SCRIPT),
      new Source('yourCssName', '/css/yourCssFile.js', SourceType.STYLE),
    ]);
  }

  async ngOnInit() {
    await this.ngxSourceService.loadBySourceName('yourJsName');
    await this.ngxSourceService.loadBySourceName('yourCssName');

    // or

    await this.ngxSourceService.loadBySourceNames('yourJsName', 'yourCssName');
  }
}
13.0.2

6 months ago

13.0.1

6 months ago

1.3.1

4 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago