Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ngx-loading-bar/router

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngx-loading-bar/router - npm Package Compare versions

Comparing version 5.0.0-alpha.2 to 5.0.0

18

bundles/ngx-loading-bar-router.umd.js

@@ -224,3 +224,3 @@ (function (global, factory) {

var _this = this;
var state = loader.useRef('router');
var ref = loader.useRef('router');
router$1.events.subscribe(function (event) {

@@ -232,6 +232,6 @@ var navState = _this.getCurrentNavigationState(router$1);

if (event instanceof router.NavigationStart) {
state.start();
ref.start();
}
if ((event instanceof router.NavigationError || event instanceof router.NavigationEnd || event instanceof router.NavigationCancel)) {
state.complete();
if (event instanceof router.NavigationError || event instanceof router.NavigationEnd || event instanceof router.NavigationCancel) {
ref.complete();
}

@@ -254,10 +254,4 @@ });

core.NgModule({
imports: [
router.RouterModule,
core$1.LoadingBarModule,
],
exports: [
router.RouterModule,
core$1.LoadingBarModule,
],
imports: [router.RouterModule, core$1.LoadingBarModule],
exports: [router.RouterModule, core$1.LoadingBarModule],
}),

@@ -264,0 +258,0 @@ __metadata("design:paramtypes", [router.Router, core$1.LoadingBarService])

import { __decorate, __metadata } from "tslib";
import { NgModule } from '@angular/core';
import { RouterModule, Router, NavigationStart, NavigationError, NavigationEnd, NavigationCancel } from '@angular/router';
import { RouterModule, Router, NavigationStart, NavigationError, NavigationEnd, NavigationCancel, } from '@angular/router';
import { LoadingBarModule, LoadingBarService } from '@ngx-loading-bar/core';
let LoadingBarRouterModule = class LoadingBarRouterModule {
constructor(router, loader) {
const state = loader.useRef('router');
router.events.subscribe(event => {
const ref = loader.useRef('router');
router.events.subscribe((event) => {
const navState = this.getCurrentNavigationState(router);

@@ -14,6 +14,6 @@ if (navState && navState.ignoreLoadingBar) {

if (event instanceof NavigationStart) {
state.start();
ref.start();
}
if ((event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel)) {
state.complete();
if (event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel) {
ref.complete();
}

@@ -37,10 +37,4 @@ });

NgModule({
imports: [
RouterModule,
LoadingBarModule,
],
exports: [
RouterModule,
LoadingBarModule,
],
imports: [RouterModule, LoadingBarModule],
exports: [RouterModule, LoadingBarModule],
}),

@@ -50,2 +44,2 @@ __metadata("design:paramtypes", [Router, LoadingBarService])

export { LoadingBarRouterModule };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtbG9hZGluZy1iYXIvcm91dGVyLyIsInNvdXJjZXMiOlsicm91dGVyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sRUFBRSxlQUFlLEVBQUUsZUFBZSxFQUFFLGFBQWEsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzFILE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBWTVFLElBQWEsc0JBQXNCLEdBQW5DLE1BQWEsc0JBQXNCO0lBQ2pDLFlBQVksTUFBYyxFQUFFLE1BQXlCO1FBQ25ELE1BQU0sS0FBSyxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7UUFDdEMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLEVBQUU7WUFDOUIsTUFBTSxRQUFRLEdBQUcsSUFBSSxDQUFDLHlCQUF5QixDQUFDLE1BQU0sQ0FBQyxDQUFDO1lBQ3hELElBQUksUUFB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GlmIChuYXZTdGF0ZSAmJiBuYXZTdGF0ZS5pZ25vcmVMb2FkaW5nQmFyKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgaWYgKGV2ZW50IGluc3RhbmNlb2YgTmF2aWdhdGlvblN0YXJ0KSB7XG4gICAgICAgIHJlZi5zdGFydCgpO1xuICAgICAgfVxuXG4gICAgICBpZiAoZXZlbnQgaW5zdGFuY2VvZiBOYXZpZ2F0aW9uRXJyb3IgfHwgZXZlbnQgaW5zdGFuY2VvZiBOYXZpZ2F0aW9uRW5kIHx8IGV2ZW50IGluc3RhbmNlb2YgTmF2aWdhdGlvbkNhbmNlbCkge1xuICAgICAgICByZWYuY29tcGxldGUoKTtcbiAgICAgIH1cbiAgICB9KTtcbiAgfVxuXG4gIHByaXZhdGUgZ2V0Q3VycmVudE5hdmlnYXRpb25TdGF0ZShyb3V0ZXI6IGFueSkge1xuICAgIC8vIGBnZXRDdXJyZW50TmF2aWdhdGlvbmAgb25seSBhdmFpbGFibGUgaW4gYW5ndWxhciBgNy4yYFxuICAgIGNvbnN0IGN1cnJlbnROYXZpZ2F0aW9uID0gcm91dGVyLmdldEN1cnJlbnROYXZpZ2F0aW9uICYmIHJvdXRlci5nZXRDdXJyZW50TmF2aWdhdGlvbigpO1xuICAgIGlmIChjdXJyZW50TmF2aWdhdGlvbiAmJiBjdXJyZW50TmF2aWdhdGlvbi5leHRyYXMpIHtcbiAgICAgIHJldHVybiBjdXJyZW50TmF2aWdhdGlvbi5leHRyYXMuc3RhdGU7XG4gICAgfVxuXG4gICAgcmV0dXJuIHt9O1xuICB9XG59XG4iXX0=
import { __decorate, __metadata } from "tslib";
import { NgModule } from '@angular/core';
import { RouterModule, Router, NavigationStart, NavigationError, NavigationEnd, NavigationCancel } from '@angular/router';
import { RouterModule, Router, NavigationStart, NavigationError, NavigationEnd, NavigationCancel, } from '@angular/router';
import { LoadingBarModule, LoadingBarService } from '@ngx-loading-bar/core';

@@ -8,3 +8,3 @@ var LoadingBarRouterModule = /** @class */ (function () {

var _this = this;
var state = loader.useRef('router');
var ref = loader.useRef('router');
router.events.subscribe(function (event) {

@@ -16,6 +16,6 @@ var navState = _this.getCurrentNavigationState(router);

if (event instanceof NavigationStart) {
state.start();
ref.start();
}
if ((event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel)) {
state.complete();
if (event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel) {
ref.complete();
}

@@ -38,10 +38,4 @@ });

NgModule({
imports: [
RouterModule,
LoadingBarModule,
],
exports: [
RouterModule,
LoadingBarModule,
],
imports: [RouterModule, LoadingBarModule],
exports: [RouterModule, LoadingBarModule],
}),

@@ -53,2 +47,2 @@ __metadata("design:paramtypes", [Router, LoadingBarService])

export { LoadingBarRouterModule };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGVyLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtbG9hZGluZy1iYXIvcm91dGVyLyIsInNvdXJjZXMiOlsicm91dGVyLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sRUFBRSxlQUFlLEVBQUUsZUFBZSxFQUFFLGFBQWEsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzFILE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBWTVFO0lBQ0UsZ0NBQVksTUFBYyxFQUFFLE1BQXlCO1FBQXJELGlCQWdCQztRQWZDLElBQU0sS0FBSyxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7UUFDdEMsTUFBTSxDQUFDLE1BQU0s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ByZXR1cm4ge307XG4gIH1cbn1cbiJdfQ==

@@ -8,4 +8,4 @@ import { __decorate, __metadata } from 'tslib';

constructor(router, loader) {
const state = loader.useRef('router');
router.events.subscribe(event => {
const ref = loader.useRef('router');
router.events.subscribe((event) => {
const navState = this.getCurrentNavigationState(router);

@@ -16,6 +16,6 @@ if (navState && navState.ignoreLoadingBar) {

if (event instanceof NavigationStart) {
state.start();
ref.start();
}
if ((event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel)) {
state.complete();
if (event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel) {
ref.complete();
}

@@ -39,10 +39,4 @@ });

NgModule({
imports: [
RouterModule,
LoadingBarModule,
],
exports: [
RouterModule,
LoadingBarModule,
],
imports: [RouterModule, LoadingBarModule],
exports: [RouterModule, LoadingBarModule],
}),

@@ -49,0 +43,0 @@ __metadata("design:paramtypes", [Router, LoadingBarService])

@@ -9,3 +9,3 @@ import { __decorate, __metadata } from 'tslib';

var _this = this;
var state = loader.useRef('router');
var ref = loader.useRef('router');
router.events.subscribe(function (event) {

@@ -17,6 +17,6 @@ var navState = _this.getCurrentNavigationState(router);

if (event instanceof NavigationStart) {
state.start();
ref.start();
}
if ((event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel)) {
state.complete();
if (event instanceof NavigationError || event instanceof NavigationEnd || event instanceof NavigationCancel) {
ref.complete();
}

@@ -39,10 +39,4 @@ });

NgModule({
imports: [
RouterModule,
LoadingBarModule,
],
exports: [
RouterModule,
LoadingBarModule,
],
imports: [RouterModule, LoadingBarModule],
exports: [RouterModule, LoadingBarModule],
}),

@@ -49,0 +43,0 @@ __metadata("design:paramtypes", [Router, LoadingBarService])

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"LoadingBarRouterModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":6,"character":4},{"__symbolic":"reference","module":"@ngx-loading-bar/core","name":"LoadingBarModule","line":7,"character":4}],"exports":[{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":10,"character":4},{"__symbolic":"reference","module":"@ngx-loading-bar/core","name":"LoadingBarModule","line":11,"character":4}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":15,"character":22},{"__symbolic":"reference","module":"@ngx-loading-bar/core","name":"LoadingBarService","line":15,"character":38}]}],"getCurrentNavigationState":[{"__symbolic":"method"}]}}},"origins":{"LoadingBarRouterModule":"./router.module"},"importAs":"@ngx-loading-bar/router"}
{"__symbolic":"module","version":4,"metadata":{"LoadingBarRouterModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":11,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":12,"character":12},{"__symbolic":"reference","module":"@ngx-loading-bar/core","name":"LoadingBarModule","line":12,"character":26}],"exports":[{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":13,"character":12},{"__symbolic":"reference","module":"@ngx-loading-bar/core","name":"LoadingBarModule","line":13,"character":26}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":16,"character":22},{"__symbolic":"reference","module":"@ngx-loading-bar/core","name":"LoadingBarService","line":16,"character":38}]}],"getCurrentNavigationState":[{"__symbolic":"method"}]}}},"origins":{"LoadingBarRouterModule":"./router.module"},"importAs":"@ngx-loading-bar/router"}
{
"name": "@ngx-loading-bar/router",
"version": "5.0.0-alpha.2",
"version": "5.0.0",
"description": "Automatic page loading / progress bar for Angular",

@@ -21,3 +21,3 @@ "keywords": [

"peerDependencies": {
"@ngx-loading-bar/core": "5.0.0-alpha.2",
"@ngx-loading-bar/core": "5.0.0",
"@angular/router": ">=7.0.0",

@@ -24,0 +24,0 @@ "tslib": "^1.10.0"

@@ -6,2 +6,3 @@ # @ngx-loading-bar/router

#### 1. Install @ngx-loading-bar/router
```bash

@@ -48,8 +49,8 @@ npm install @ngx-loading-bar/router --save

export class AppComponent {}
```
## Related packages
- [@ngx-loading-bar/http-client](./../../packages/http-client/README.md) - Display the progress of your `@angular/common/http` requests.
- [@ngx-loading-bar/http](./../../packages/http/README.md) - Display the progress of your `@angular/http` requests.
- [@ngx-loading-bar/core](./../../packages/core/README.md) - Core module to manage the progress bar manually.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc