Skip to content

Instantly share code, notes, and snippets.

@panda4man
Created January 18, 2015 01:28
Show Gist options
  • Select an option

  • Save panda4man/dd173cd3692dc3bcea13 to your computer and use it in GitHub Desktop.

Select an option

Save panda4man/dd173cd3692dc3bcea13 to your computer and use it in GitHub Desktop.

Revisions

  1. panda4man created this gist Jan 18, 2015.
    36 changes: 36 additions & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    $stateProvider
    .state('app', {
    url: "/app",
    abstract: true,
    controller: 'MainCtrl',
    templateUrl: "templates/tabs.html",
    resolve: {
    Migrations: ['$q', 'InitService', function($q, Init) {
    return Init.promise.then(function(good) {
    return good;
    }, function(err) {
    return err;
    });
    }]
    }
    })
    .state('app.classes', {
    url: "/classes/:id/:name/:year",
    cache: false,
    views: {
    'tab-gradebook': {
    templateUrl: "templates/classes.html",
    controller: 'ClassesCtrl',
    resolve: {
    Classes: function(ClassFactory, $stateParams) {
    return ClassFactory.all($stateParams.id).then(function(c) {
    return c;
    }, function(fail) {
    console.log(fail);
    return [];
    });
    }
    }
    }
    }
    })