Ich möchte Toast in meiner App zeigen. Dafür habe ich verwendet:Toast mit Fehler
mySchoolApp.controller('loginController', ['$scope', '$http', function($scope, $http,$location, $mdToast) {
this.loginForm = function() {
let uname = this.inputData.username;
let pass= this.inputData.password;
if (pass === 123456) {
sessionStorage.setItem("userID", '123456');
window.location.href = '#dashboard';
} else {
$mdToast.show(
$mdToast.simple()
.textContent('Either email or password is incorrect!')
.position("top right")
.hideDelay(3000)
);
}
})
.error(function(data, status, headers, config) {
//error msgs
})
}
}]);
Aber während meine Anwendung ausgeführt wird, das die folgenden Fehler zeigt:
TypeError: Cannot read property 'show' of undefined
Wie dieses Problem in meiner Anwendung sortieren?
Können Sie eine Geige/Plunker für diese teilen? – Vaibhav