DefinitelyTyped/types/ng-command/ng-command-tests.ts
2017-03-24 14:27:52 -07:00

23 lines
506 B
TypeScript

var app = angular.module('testModule', ['ng-command']);
class CommandTestController {
constructor($command: ngCommand.ICommandFactory, $scope: ng.IScope, $timeout: ng.ITimeoutService) {
var cmd = $command($scope, () => {
return $timeout(() => {}, 0)
})
var cmdWithCanExecute = $command($scope, () => {
return $timeout(() => {}, 0)
}, () => false);
cmd.isExecuting === false;
cmd.canExecute === false;
cmd.execute();
}
}
app.controller('TestController', CommandTestController);