New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ngx-source

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-source - npm Package Compare versions

Comparing version
1.3.0
to
1.3.1
+1
-1
package.json
{
"name": "ngx-source",
"version": "1.3.0",
"version": "1.3.1",
"peerDependencies": {

@@ -5,0 +5,0 @@ "@angular/common": "~6.1.10",

+15
-23
# ngx source
[![Build Status](https://travis-ci.org/mehrabisajad/ngx-source.svg?branch=master)](https://travis-ci.org/mehrabisajad/ngx-source)
[![codecov](https://codecov.io/gh/mehrabisajad/ngx-source/branch/master/graph/badge.svg)](https://codecov.io/gh/mehrabisajad/ngx-source)
angular source, can load js and css in runtime
[![npm version](https://badge.fury.io/js/ngx-source.svg)](http://badge.fury.io/js/ngx-source)
[![devDependency Status](https://david-dm.org/mehrabisajad/ngx-source/dev-status.svg)](https://david-dm.org/mehrabisajad/ngx-source?type=dev)
[![GitHub issues](https://img.shields.io/github/issues/mehrabisajad/ngx-source.svg)](https://github.com/mehrabisajad/ngx-source/issues)

@@ -10,11 +9,2 @@ [![GitHub stars](https://img.shields.io/github/stars/mehrabisajad/ngx-source.svg)](https://github.com/mehrabisajad/ngx-source/stargazers)

## Table of contents
- [About](#about)
- [Installation](#installation)
## About
angular source, can load js and css in runtime
## Installation

@@ -29,24 +19,26 @@

```typescript
import { Component,OnInit } from '@angular/core';
import { Source, SourceType, NgxSourceService } from "ngx-source";
import { Component, OnInit } from '@angular/core';
import { Source, SourceType, NgxSourceService } from 'ngx-source';
@Component({
template: ''
template: 'your-component'
})
export class MyComponent implements OnInit {
export class YourComponent implements OnInit {
constructor(private ngxSourceService: NgxSourceService) {
this.ngxSourceService.addSource(
new Source('jquery', '/js/jquery.js', SourceType.SCRIPT)
);
this.ngxSourceService.addSources([
new Source('yourJsName', '/js/yourJsFile.js', SourceType.SCRIPT),
new Source('yourCssName', '/css/yourCssFile.js', SourceType.STYLE)
]);
}
async ngOnInit() {
await this.ngxSourceService.load('jquery');
await this.ngxSourceService.loadBySourceName('yourJsName');
await this.ngxSourceService.loadBySourceName('yourCssName');
// use it
// or
await this.ngxSourceService.loadBySourceNames('yourJsName', 'yourCssName');
}
}
```