Skip to content

Commit e799ee3

Browse files
authored
Merge pull request #7239 from IgniteUI/SIvanova/migrate-toast-message
chore(toast): migrate toast message property to text content
2 parents 100d6f7 + 3482ae6 commit e799ee3

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

projects/igniteui-angular/migrations/update-9_1_0/changes/inputs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
"selector": "igx-input-group",
99
"type": "component"
1010
}
11+
},
12+
{
13+
"name": "message",
14+
"moveBetweenElementTags": true,
15+
"owner": {
16+
"selector": "igx-toast",
17+
"type": "component"
18+
}
1119
}
1220
]
1321
}

projects/igniteui-angular/migrations/update-9_1_0/index.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,18 @@ describe('Update 9.1.0', () => {
4141

4242
done();
4343
});
44+
45+
it('should move igx-toast message property between element tags', done => {
46+
appTree.create(
47+
`/testSrc/appPrefix/component/input.component.html`,
48+
'<igx-toast message="test message"></igx-toast>'
49+
);
50+
51+
const tree = schematicRunner.runSchematic('migration-15', {}, appTree);
52+
53+
expect(tree.readContent('/testSrc/appPrefix/component/input.component.html'))
54+
.toEqual('<igx-toast>test message</igx-toast>');
55+
56+
done();
57+
});
4458
});
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<div #content>
2-
<ng-content></ng-content>
3-
</div>
4-
<span *ngIf="content.childNodes.length == 0">{{ message }}</span>
1+
<ng-content></ng-content>
2+
<span>{{ message }}</span>
53

projects/igniteui-angular/src/lib/toast/toast.component.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,8 @@ export class IgxToastComponent implements IToggleView, OnInit, OnDestroy {
192192
public isVisibleChange = new EventEmitter<boolean>();
193193

194194
/**
195-
* @deprecated Place your message in the toast content instead.
196-
* Sets/gets the message that will be shown by the toast.
197-
* ```html
198-
* <igx-toast [message] = "Notification"></igx-toast>
199-
* ```
200-
* ```typescript
201-
* let toastMessage = this.toast.message;
202-
* ```
203-
* @memberof IgxToastComponent
195+
* @hidden
204196
*/
205-
@DeprecateProperty(`'message' @Input property is deprecated. Place your message in the toast content instead.`)
206197
@Input()
207198
public message = '';
208199

0 commit comments

Comments
 (0)