Skip to content

Commit

Permalink
Merge pull request #89 from MurhafSousli/fix/2.1.0
Browse files Browse the repository at this point in the history
v2.1.1
  • Loading branch information
MurhafSousli authored Oct 25, 2017
2 parents b7e372c + b689c9a commit c3e3d57
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 14 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Changelog

## 2.1.0
## 2.1.1

- Allow `<ng-progress>` component to be destroyed, fixes [#27](https://github.com/MurhafSousli/ngx-progressbar/issues/27), [#28](https://github.com/MurhafSousli/ngx-progressbar/issues/28), [#33](https://github.com/MurhafSousli/ngx-progressbar/issues/33), [#41](https://github.com/MurhafSousli/ngx-progressbar/issues/41), [#81](https://github.com/MurhafSousli/ngx-progressbar/issues/81), [#82](https://github.com/MurhafSousli/ngx-progressbar/issues/82) in [#86](https://github.com/MurhafSousli/ngx-progressbar/issues/86)

- Add `NgProgressState` interface for Progress state
- **Breaking Changes**: `NgProgressService` has been renamed to `NgProgress`

## 2.1.0

**Broken Release**

## 2.0.8

- fix: remove unused code in [#68](https://github.com/MurhafSousli/ngx-progressbar/issues/68)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-progressbar",
"version": "2.1.0",
"version": "2.1.1",
"description": "A nanoscopic progress bar. Featuring realistic trickle animations to convince your users that something is happening!",
"main": "./bundles/ngx-progressbar.umd.js",
"module": "./modules/ngx-progressbar.es5.js",
Expand Down
1 change: 1 addition & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const globals = {
'@angular/http': 'ng.http',
'rxjs/Observable': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/BehaviorSubject': 'Rx',
'rxjs/add/observable/timer': 'Rx.Observable',
'rxjs/add/operator/do': 'Rx.Observable.prototype',
'rxjs/add/operator/takeWhile': 'Rx.Observable.prototype',
Expand Down
17 changes: 9 additions & 8 deletions src/components/progress-bar.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { NgProgressState } from '../models/progress.state';

@Component({
selector: 'ng-progress-bar',
Expand Down Expand Up @@ -126,14 +127,14 @@ import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
})
export class ProgressBarComponent {

@Input() state;
@Input() positionUsing;
@Input() ease;
@Input() speed;
@Input() showSpinner;
@Input() direction;
@Input() thick;
@Input() color;
@Input() state: NgProgressState;
@Input() positionUsing: string;
@Input() ease: string;
@Input() speed: number;
@Input() showSpinner: boolean;
@Input() direction: string;
@Input() thick: string;
@Input() color: string;

/** Styles for progressbar */
barStyles() {
Expand Down
3 changes: 1 addition & 2 deletions src/components/progress.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { NgProgress } from '../services/progress.service';
[direction]="direction"
[color]="color"
[thick]="thick"
[state]="progress.state | async"
[state]="ngProgress.state | async"
></ng-progress-bar>`,
styles: [`
:host {
Expand Down Expand Up @@ -94,5 +94,4 @@ export class ProgressComponent implements OnChanges {
}
}
}

}
4 changes: 4 additions & 0 deletions src/models/progress.state.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface NgProgressState {
active: boolean;
value: number;
}
1 change: 1 addition & 0 deletions src/progressbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { NgProgress } from './services/progress.service';
export { NgProgressBrowserXhr } from './services/browser-xhr.provider';
export { NgProgressInterceptor } from './services/interceptor.provider';
export { NgProgressModule } from './modules/progress.module';
export { NgProgressState } from './models/progress.state';
10 changes: 9 additions & 1 deletion src/services/progress.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { NgProgressState } from '../models/progress.state';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Observable } from 'rxjs/Observable';

import 'rxjs/add/observable/timer';
Expand All @@ -21,8 +23,14 @@ const clamp = (n, min, max) => {
@Injectable()
export class NgProgress {

/** Initial state */
initState: NgProgressState = {
active: false,
value: 0
};

/** Progress state */
state = new Subject();
state = new BehaviorSubject(this.initState);

/** Trickling stream */
trickling = new Subject();
Expand Down
1 change: 1 addition & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"no-forward-ref": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"interface-name": false,
"component-class-suffix": [
true,
"Component"
Expand Down

0 comments on commit c3e3d57

Please sign in to comment.