javascripter
TypeScript icon, indicating that this package has built-in type declarations

0.0.7Β β€’Β PublicΒ β€’Β Published

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 => {
      // Do something...
    });
  }
}

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})  // To remove logs
  ],
  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 πŸ˜€

Package Sidebar

Install

npm i javascripter

Weekly Downloads

1

Version

0.0.7

License

MIT

Unpacked Size

107 kB

Total Files

27

Last publish

Collaborators

  • leonlafa