import { ExecutionService } from './execution.service';
var ThingsService = (function () {
    function ThingsService($state) {
        this.$state = $state;
    }
    ThingsService.prototype.load = function (flow, things, model, state) {
        this.executionService = new ExecutionService(flow, things, model);
        if (state) {
            this.executionService.go(state);
        }
        else {
            this.executionService.start();
        }
    };
    ThingsService.prototype.getCurrentThing = function () {
        return this.executionService.getCurrent();
    };
    ThingsService.prototype.next = function () {
        var nextThing = this.executionService.next();
        this.$state.go(this.$state.current.name, { state: nextThing.key });
    };
    ThingsService.$inject = ['$state'];
    return ThingsService;
}());
export { ThingsService };
//# sourceMappingURL=things.service.js.map