External service integration demo (work in progress)

This commit is contained in:
Denys Vuika
2016-06-08 19:10:38 +01:00
parent cce62b52ba
commit d177470b01
3 changed files with 113 additions and 4 deletions

View File

@@ -15,14 +15,39 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Component, OnInit } from 'angular2/core';
import { ActivitiService } from './activiti.service';
@Component({
selector: 'tasks-demo',
template: `
<h2>Tasks</h2>
`
<ul>
<li *ngFor="#task of tasks">
{{task.name}}
</li>
</ul>
`,
providers: [ActivitiService]
})
export class TasksDemoComponent {
export class TasksDemoComponent implements OnInit {
tasks: any[];
constructor(
private activitiService: ActivitiService) {}
ngOnInit() {
this.activitiService
.login('denys.vuika@alfresco.com', 'test')
.then(() => {
this.activitiService
.getTasks()
.then((tasks) => {
this.tasks = tasks || []
console.log(this.tasks);
});
});
}
}