• Jump To … +
    auth.js comments.js glint.js ideas.js votes.js services.js commentController.js commentModel.js commentRoutes.js helpers.js middleware.js ideaController.js ideaModel.js ideaRoutes.js serverSetup.js serverSpec.js usersController.js usersModel.js usersRoutes.js voteController.js voteRoutes.js
  • glint.js

  • ¶

    Glint

  • ¶

    This is our app’s main Angular module.

  • ¶

    Our dependencies are by shared services, feature controllers, and third-party modules.

    var app = angular.module('glint', [
      'glint.services',
      'glint.ideas',
      'glint.votes',
      'glint.auth',
      'glint.comments',
      'ngAnimate',
      'ngRoute'
      ])
  • ¶

    Routing configuration. Eventually, this is where the controllers for the specific views will be declared, so they don’t have to be referred to in our HTML. (Eg. instead of AuthCtrl.)

    .config(function($routeProvider){
    	$routeProvider
    		.when('/', {
            templateUrl: 'app/ideas/ideas.html'
          })
        .when('/login', {
            templateUrl: 'app/auth/login.html'
          })
        .when('/signup', {
            templateUrl: 'app/auth/signup.html'
          })
        .otherwise({
            redirectTo: '/'
          });
    })
  • ¶

    Custom filter for applying moment.js to our timestamps.

    .filter('moment', function () {
      return function (dateString) {
          return moment(dateString).fromNow();
      };
    });