DefinitelyTyped/ng-command/ng-command-tests.ts
2015-07-26 19:30:46 +02:00

26 lines
599 B
TypeScript

/// <reference path="ng-command.d.ts" />
/// <reference path="../angularjs/angular.d.ts" />
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);