Created
June 4, 2015 15:59
-
-
Save johnpapa/7c2b62ded5b40cdf4f64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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