Button icon is not dynamic #1408

Closed
mischkl opened this Issue Nov 23, 2016 · 0 comments

Projects

None yet

2 participants

@mischkl
Contributor
mischkl commented Nov 23, 2016

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
If a button's icon is bound to a field in the parent component and that field changes, it does not react to the change.

Expected behavior
If the field changes the icon should also change.

Minimal reproduction of the problem with instructions

@Component({
  selector: 'my-component',
  template: '<button pButton [icon]="myIcon" (click)="onClick()"></button>'
})
export class MyComponent {
  myIcon: string = 'fa-bell';

  onClick() {
    this.myIcon = 'fa-bell-o';
  }
}

Icon should change, but doesn't.

What is the motivation / use case for changing the behavior?
In my case it is a toggle button that should change the icon based on the state of the toggle.

Please tell us about your environment:
Windows 7, Node 6.9.1

  • Angular version: 2.1.0

  • PrimeNG version: 1.0.0

  • Browser: all

  • Language: TypeScript

@Thavarajan Thavarajan added a commit to Thavarajan/primeng that referenced this issue Nov 26, 2016
@Thavarajan Thavarajan Apply ngonchnages for icon and it's position
fix bug #1408
de9d46e
@cagataycivici cagataycivici self-assigned this Dec 20, 2016
@cagataycivici cagataycivici added this to the 1.1.1 milestone Dec 20, 2016
@cagataycivici cagataycivici added a commit that closed this issue Dec 20, 2016
@cagataycivici cagataycivici Fixed #1408 b976a9d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment