@@ -53,7 +53,7 @@ function MdToastDirective($mdToast) {
53
53
* var app = angular.module('app', ['ngMaterial']);
54
54
* app.controller('MyController', function($scope, $mdToast) {
55
55
* $scope.openToast = function($event) {
56
- * $mdToast.show($mdToast.simple().content ('Hello!'));
56
+ * $mdToast.show($mdToast.simple().textContent ('Hello!'));
57
57
* // Could also do $mdToast.showSimple('Hello');
58
58
* };
59
59
* });
@@ -84,7 +84,7 @@ function MdToastDirective($mdToast) {
84
84
* _**Note:** These configuration methods are provided in addition to the methods provided by
85
85
* the `build()` and `show()` methods below._
86
86
*
87
- * - `.content (string)` - Sets the toast content to the specified string.
87
+ * - `.textContent (string)` - Sets the toast content to the specified string.
88
88
*
89
89
* - `.action(string)` - Adds an action button. If clicked, the promise (returned from `show()`)
90
90
* will resolve with the value `'ok'`; otherwise, it is resolved with `true` after a `hideDelay`
@@ -102,7 +102,7 @@ function MdToastDirective($mdToast) {
102
102
103
103
/**
104
104
* @ngdoc method
105
- * @name $mdToast#updateContent
105
+ * @name $mdToast#updateTextContent
106
106
*
107
107
* @description
108
108
* Updates the content of an existing toast. Useful for updating things like counts, etc.
@@ -206,8 +206,8 @@ function MdToastProvider($$interimElementProvider) {
206
206
options : toastDefaultOptions
207
207
} )
208
208
. addPreset ( 'simple' , {
209
- argOption : 'content ' ,
210
- methods : [ 'content' , 'action' , 'highlightAction' , 'theme' , 'parent' ] ,
209
+ argOption : 'textContent ' ,
210
+ methods : [ 'textContent' , ' content', 'action' , 'highlightAction' , 'theme' , 'parent' ] ,
211
211
options : /* @ngInject */ function ( $mdToast , $mdTheming ) {
212
212
var opts = {
213
213
template : [
@@ -234,9 +234,12 @@ function MdToastProvider($$interimElementProvider) {
234
234
return opts ;
235
235
}
236
236
} )
237
- . addMethod ( 'updateContent' , function ( newContent ) {
237
+ . addMethod ( 'updateTextContent' , updateTextContent )
238
+ . addMethod ( 'updateContent' , updateTextContent ) ;
239
+
240
+ function updateTextContent ( newContent ) {
238
241
activeToastContent = newContent ;
239
- } ) ;
242
+ }
240
243
241
244
return $mdToast ;
242
245
@@ -252,7 +255,7 @@ function MdToastProvider($$interimElementProvider) {
252
255
} ;
253
256
254
257
function onShow ( scope , element , options ) {
255
- activeToastContent = options . content ;
258
+ activeToastContent = options . textContent || options . content ; // support deprecated #content method
256
259
257
260
element = $mdUtil . extractElementByName ( element , 'md-toast' , true ) ;
258
261
options . onSwipe = function ( ev , gesture ) {
0 commit comments