Skip to content

Commit

Permalink
Added toast class property to toast options/config object per commit … (
Browse files Browse the repository at this point in the history
DefinitelyTyped#11132)

* Added toast class property to toast options/config object per commit f72c7816. Added id property to panel config per commit d230aec.

* Added onClose() callback to sidenav object per commit 1f01d264.
  • Loading branch information
AlStar01 authored and vvakame committed Sep 9, 2016
1 parent fc1b3e1 commit f665c7f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions angular-material/angular-material-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,30 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
instance.isOpen();
instance.isLockedOpen();
});

$scope['onClose'] = $mdSidenav(componentId).onClose(() => {});
});

myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
$scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!'));

$scope['customToast'] = () => {
var options = {
hideDelay: 3000,
position: 'top right',
controller : 'ToastCtrl',
templateUrl : 'toast-template.html',
toastClass: 'my-class'
};

$mdToast.show(options);
}
});

myApp.controller('PanelController', ($scope: ng.IScope, $mdPanel: ng.material.IPanelService) => {
$scope['createPanel'] = () => {
var config = {
id: 'myPanel',
template: '<h1>Hello!</h1>',
hasBackdrop: true,
disableParentScroll: true,
Expand Down
3 changes: 3 additions & 0 deletions angular-material/angular-material.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ declare namespace angular.material {
close(): angular.IPromise<void>;
isOpen(): boolean;
isLockedOpen(): boolean;
onClose(onClose: Function): void;
}

interface ISidenavService {
Expand Down Expand Up @@ -162,6 +163,7 @@ declare namespace angular.material {
preserveScope?: boolean; // default: false
hideDelay?: number; // default (ms): 3000
position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left'
toastClass?: string;
controller?: string|Function;
locals?: {[index: string]: any};
bindToController?: boolean; // default: false
Expand Down Expand Up @@ -291,6 +293,7 @@ declare namespace angular.material {
}

interface IPanelConfig {
id?: string;
template?: string;
templateUrl?: string;
controller?: string|Function;
Expand Down

0 comments on commit f665c7f

Please sign in to comment.