Skip to content
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

Closed
Pixcell opened this issue May 13, 2016 · 6 comments
Closed

Determinate progress-bar broken in @angular rc1 #430

Pixcell opened this issue May 13, 2016 · 6 comments
Assignees
Labels
P2 The issue is important to a large percentage of users, with a workaround
Milestone

Comments

@Pixcell
Copy link

Pixcell commented May 13, 2016

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.

  • Do you want to request a feature or report a bug?

Bug

  • What is the current behavior?

Determinate progress bar always at 100% (or 0, can't tell)

  • If the current behavior is a bug,
    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>

screen shot 2016-05-13 at 08 49 08

  • What is the expected behavior?

Progress bar to be filled with the correct percentage

  • What is the motivation / use case for changing the behavior?
  • Which version of Angular and Material, and which browser and OS does this issue affect?
    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

  • Other information
    (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix)
@jelbourn jelbourn changed the title alpha4 - @angular.rc1 - Progress bar determinate mode not working Determinate progress-bar broken in @angular rc1 May 13, 2016
@jelbourn jelbourn added the P2 The issue is important to a large percentage of users, with a workaround label May 13, 2016
@jelbourn jelbourn added this to the alpha.6 milestone May 13, 2016
@devversion
Copy link
Member

I tested that locally and it seems to be fixed within master / HEAD

@szechyjs
Copy link

szechyjs commented May 16, 2016

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>

@josephperrott
Copy link
Member

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

@Pixcell
Copy link
Author

Pixcell commented May 17, 2016

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>

screen shot 2016-05-17 at 08 48 40

screen shot 2016-05-17 at 08 56 05

    "@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.
Working with Chrome Version 50.0.2661.94 (64-bit) on Mac OSX

@msegers
Copy link

msegers commented May 26, 2016

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()"

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

No branches or pull requests

6 participants