Skip to content

Instantly share code, notes, and snippets.

@malikperang
Created November 15, 2016 09:15
Show Gist options
  • Save malikperang/ce4967518dc2d049ff3d249272a7adf4 to your computer and use it in GitHub Desktop.
Save malikperang/ce4967518dc2d049ff3d249272a7adf4 to your computer and use it in GitHub Desktop.
lecturer dashboard
import angular from 'angular';
import angularMeteor from 'angular-meteor';
import uiRouter from 'angular-ui-router';
import 'chart.js/dist/Chart.js';
import 'angular-chart.js/dist/angular-chart.js';
import { Meteor } from 'meteor/meteor';
import { Transactions } from '../../../api/transactions.js';
import { countTotalStudent } from '../../../api/aggregations.js';
import template from './lecturerdashboard.html';
class LecturerDashboard{
constructor($scope,$state,$log,$reactive){
'ngInject';
$reactive(this).attach($scope);
this.subscribe('countTotalStudent');
var totalStudents = countTotalStudent.find();
this.helpers({
test(){
console.log(totalStudents.fetch());
}
});
}
const name = 'lecturerdashboard';
export default angular.module(name, [angularMeteor, uiRouter,'chart.js'])
.component(name, {
template,
controllerAs: name,
controller: LecturerDashboard
})
.config(config);
function config($stateProvider) {
'ngInject';
$stateProvider
.state('lecturerdashboard', {
url: '/lecturerdashboard',
template: '<lecturerdashboard></lecturerdashboard>'
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment