UNPKG

todomvc

Version:

> Helping you select an MV\* framework

33 lines (29 loc) 660 B
/*global angular */ /** * The main TodoMVC app module * * @type {angular.Module} */ angular.module('todomvc', ['ngRoute']) .config(function ($routeProvider) { 'use strict'; var routeConfig = { controller: 'TodoCtrl', templateUrl: 'todomvc-index.html', resolve: { store: function (todoStorage) { // Get the correct module (API or localStorage). return todoStorage.then(function (module) { module.get(); // Fetch the todo records in the background. return module; }); } } }; $routeProvider .when('/', routeConfig) .when('/:status', routeConfig) .otherwise({ redirectTo: '/' }); });