Skip to content

Instantly share code, notes, and snippets.

@johnpapa
Created June 4, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnpapa/7c2b62ded5b40cdf4f64 to your computer and use it in GitHub Desktop.
Save johnpapa/7c2b62ded5b40cdf4f64 to your computer and use it in GitHub Desktop.
'use strict';
class DashboardController {
static $inject: Array<string> = ['$q', 'dataservice', 'logger'];
constructor(private $q: ng.IQService,
private dataservice: app.core.IDataService,
private logger: blocks.logger.Logger) {
var promises = [this.getMessageCount(), this.getPeople()];
this.$q.all(promises).then(function () {
logger.info('Activated Dashboard View');
});
}
news = {
title: 'helloworld',
description: 'Hot Towel Angular is a SPA template for Angular developers.'
};
messageCount: number = 0;
people: Array<any> = [];
title: string = 'Dashboard';
getMessageCount() {
return this.dataservice.getMessageCount().then((data) => {
this.messageCount = data;
return this.messageCount;
});
}
getPeople() {
return this.dataservice.getPeople().then((data) => {
this.people = data;
return this.people;
});
}
}
angular
.module('app.dashboard')
.controller('DashboardController', DashboardController);
export default 'app.dashboard'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment