-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determinate progress-bar broken in @angular rc1 #430
Comments
I tested that locally and it seems to be fixed within |
I had this problem with rc.0 as well, the solution was to properly use value as an input. Change: <md-progress-bar mode="determinate" color="{{getColor(h.pid.percentage)}}" value={{h.pid.percentage}}></md-progress-bar> To: <md-progress-bar mode="determinate" color="{{getColor(h.pid.percentage)}}" [value]="h.pid.percentage"></md-progress-bar> |
As @szechyjs pointed out, because custom web components do not have a built in value property, you will need to use the angular property binding syntax [] to provide the value to the component. Marking as closed as this is working as intended |
I am deeply sorry to re-open this issue. But I had already tried this, and it doesn't work. You'll find below the relevant part of html code, html output, angular component, package.json, etc. import {MdToolbar} from '@angular2-material/toolbar';
import {MdButton} from '@angular2-material/button';
import {MdCard} from '@angular2-material/card';
import {MdProgressBar} from '@angular2-material/progress-bar';
@Component({
selector: 'home',
templateUrl: 'components/home/home.component.html',
styleUrls: ['components/home/home.component.css'],
providers: [],
directives: [MdToolbar, MdButton, MdCard, MdProgressBar]
})
export class HomeComponent implements OnInit{ <p>
<span>PID completion {{h.pid.percentage}}%</span><span *ngIf="h.pid.warning">{{h.pid.warning}} </span>
<md-progress-bar mode="determinate" [value]="h.pid.percentage"></md-progress-bar>
</p> "@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"@angular/router": "^2.0.0-rc.1",
"@angular/router-deprecated": "^2.0.0-rc.1",
"@angular2-material/button": "^2.0.0-alpha.4",
"@angular2-material/card": "^2.0.0-alpha.4",
"@angular2-material/checkbox": "^2.0.0-alpha.4",
"@angular2-material/core": "^2.0.0-alpha.4",
"@angular2-material/icon": "^2.0.0-alpha.4",
"@angular2-material/input": "^2.0.0-alpha.4",
"@angular2-material/progress-bar": "^2.0.0-alpha.4",
"@angular2-material/progress-circle": "^2.0.0-alpha.4",
"@angular2-material/radio": "^2.0.0-alpha.4",
"@angular2-material/sidenav": "^2.0.0-alpha.4",
"@angular2-material/toolbar": "^2.0.0-alpha.4", Please tell me if you need anything else. |
Hey I'd just want to share my 2 cents. I was debugging this as well, and put some console.log's in the js files in my node_modules folder. The logic all still works, it tries to set a correct scaleX value on the element, however I believe the way the bindings are set up [style.transform=somefunc()] <- from top of head don't have it here. Does not actually work, when I slap the exact string provided as by the function in the element's style within chrome it works like a charm. I just think the bindings like that broke on angular RC1 like more things did for me when binding style. Maybe there is a more explicit version e.g. [style.tranform.scaleX]="somefunc()" |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Note: for support questions, please use one of these channels:
https://github.com/angular/material2/blob/master/CONTRIBUTING.md#question.
This repository's issues are reserved for feature requests and bug reports.
Bug
Determinate progress bar always at 100% (or 0, can't tell)
please provide steps to reproduce and if possible a minimal demo of the problem
via https://plnkr.co or similar.
<p> <span>PID completion {{h.pid.percentage}}%</span><span *ngIf="h.pid.warning">{{h.pid.warning}}</span> <md-progress-bar mode="determinate" color="{{getColor(h.pid.percentage)}}" value={{h.pid.percentage}}></md-progress-bar> </p>
Progress bar to be filled with the correct percentage
Did this work in previous versions of Angular / Material?
Please also test with the latest stable and snapshot versions.
Chrome latest version. @angular2-material.alpha.4. @angular2.rc.1
(e.g. detailed explanation, stacktraces, related issues, suggestions how to fix)
The text was updated successfully, but these errors were encountered: