i399exng1ts/app/list.ctrl.ts

22 lines
421 B
TypeScript
Raw Normal View History

2017-05-17 18:36:09 +03:00
import { Post } from './post.cls';
import { DataService } from "./data.srv.i";
function ListCtrl(dataService: any) {
var vm = this;
vm.posts = [];
init();
function init() {
dataService.getPosts()
.then(function (result : any) {
vm.posts = result;
});
}
}
ListCtrl.$inject = ['dataService'];
angular.module('app').controller('ListCtrl', ListCtrl);