JavaScripter
A library for loading scripts ๐

Usage
Component
import { Component } from "@angular/core";
import { JavaScripter } from "javascripter";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"]
})
export class AppComponent {
title = "javascripter-demo-app";
constructor(private javascripter: JavaScripter) {
this.javascripter.createScripts([
"https://cdnjs.cloudflare.com/ajax/libs/animejs/2.2.0/anime.js",
"https://unpkg.com/material-components-web@latest/dist/material-components-web.min.js",
"https://code.jquery.com/jquery-3.3.1.slim.min.js"
]);
this.javascripter.onLoaded.subscribe(loaded => {
});
}
}
Module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { JavaScripterModule } from 'javascripter';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
JavaScripterModule.forRoot({logger: false})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Was this lib useful?
If you found this lib useful,
please โญ๏ธthe lib to show your appreciation!
In the spirit of open-source, share this lib with others in the community who might find it useful ๐