Skip to content
This repository was archived by the owner on Jun 16, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/select/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export class MdlOptionComponent {
} else {
this.selected = this.value == value;
}
this.changeDetectionRef.detectChanges();
if (!(<any>this.changeDetectionRef)['destroyed']) {
this.changeDetectionRef.detectChanges();
}
}

ngAfterViewInit() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/select/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-mdl/select",
"version": "0.11.1",
"version": "0.11.2",
"description": "Angular 2 Material Design Lite - Select Component",
"main": "./index.umd.js",
"module": "./index.js",
Expand Down
21 changes: 21 additions & 0 deletions src/e2e-app/app/select/select.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,27 @@ <h5>Multiple with initial value</h5>
</pre>


<h5>Dynamically generated selects with *ngFor</h5>

<div *ngFor="let countryCode of countryCodes; let i = index">
<mdl-select [(ngModel)]="countryCodes[i]" [placeholder]="'Select '+i">
<mdl-option *ngFor="let c of countries" [value]="c.code">{{c.name}}</mdl-option>
</mdl-select>
</div>

<pre>countryCodes: {{ countryCodes | json }}</pre>

<pre prism ngNonBindable>
<![CDATA[
<div *ngFor="let countryCode of countryCodes; let i = index">
<mdl-select [(ngModel)]="countryCodes[i]" [placeholder]="'Select '+i">
<mdl-option *ngFor="let c of countries" [value]="c.code">{{c.name}}</mdl-option>
</mdl-select>
</div>
]]>
</pre>


<h5>Dynamic multiselect</h5>

<p>
Expand Down