Skip to content

Instantly share code, notes, and snippets.

@seemaullal
Created July 20, 2015 18:29
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 seemaullal/bb9d5080015247863e62 to your computer and use it in GitHub Desktop.
Save seemaullal/bb9d5080015247863e62 to your computer and use it in GitHub Desktop.
Angular Sample #2
// This is a state and the controller that corresponds to the state
'use strict';
angular.module('learndotApp')
.config(function ($stateProvider) {
$stateProvider
.state('calendar', {
url: '/calendar',
controller: 'CalendarCtrl',
templateUrl: 'app/calendar/calendar.html',
resolve: {
user: function(Auth) {
return Auth.getCurrentUserAsync();
},
cohort: function(UserCohortHelper, user) {
var helper = UserCohortHelper(user);
return helper.getCohortObjects()
.then(function(cohort) {
return cohort;
});
}
},
authenticate: true
});
});
//Controller
'use strict';
angular.module('learndotApp')
.controller('CalendarCtrl', function ($scope, $sce,cohort) {
$scope.calendarLink = $sce.trustAsResourceUrl(cohort.calendarLink);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment