mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
25 lines
541 B
TypeScript
25 lines
541 B
TypeScript
/// <reference types="angular" />
|
|
|
|
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);
|