Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
ngx-fi-styles-loader
Advanced tools
Readme
A streamlined approach to load styles dynamically
npm i lodash --save
npm i @types/lodash --save-dev
npm i ngx-fi-lodash --save
npm i ngx-fi-styles-loader --save
import { NgModule } from "@angular/core";
import { NgxFiStylesLoaderModule } from "ngx-fi-styles-loader";
@NgModule({
imports: [NgxFiStylesLoaderModule], // for consumption within the scope of the module
exports: [NgxFiStylesLoaderModule] // if propagation is required
})
export class SomeModule {}
import { StyleHandlingMode, StylesLoaderService } from "ngx-fi-styles-loader";
export class SomeClass {
constructor(private loaderService: StylesLoaderService) {}
}
import { NgxFiStylesLoaderTestingModule, StylesLoaderMockService, StylesLoaderService } from "ngx-fi-styles-loader";
describe('TestingTitle', () => {
let stylesLoaderService: StylesLoaderMockService;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [NgxFiStylesLoaderTestingModule]
});
stylesLoaderService = TestBed.get(StylesLoaderService);
}));
}));
}));
components:
StylesLoaderComponent
/ styles-loader
: to be used when managed loading of styles is requiredStylesLoaderRawComponent
/ styles-loader-raw
: to be used when un-managed loading of styles is requiredenums:
StyleHandlingMode
PassThrough
: just passes the url to be loadedVerifiedPassThrough
: downloads content first, passed the url to be loaded on successLiteral
: downloads the content and passes it as an object url; should not be used when stylesheet contains any relative paths referencing assetsservices:
StylesLoaderService
: used in conjuction with StylesLoaderComponent
to load styles; in addition, info regarding the loading status of a style(s) are provided
export interface IStylesLoaderService {
loadingStyles$: Observable<{ [key: string]: string }>;
isStyleLoading(url: string): boolean;
isStyleLoading$(url: string): Observable<boolean>;
areStylesLoading(urls: string[]): boolean;
areStylesLoading$(urls: string[]): Observable<boolean>;
getStyle$(url: string, styleHandlingMode?: StyleHandlingMode): Observable<string>;
}
FAQs
A streamlined approach to load styles dynamically
We found that ngx-fi-styles-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).