Last active
December 16, 2015 20:49
-
-
Save debuggerpk/5495481 to your computer and use it in GitHub Desktop.
templateUrl not invoking in angular.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('cricketapp', []). | |
config(['$routeProvider', function($routeProvider){ | |
$routeProvider. | |
when('/dashboard', {templateUrl: 'partials/pending-games.html', controller: GameListCtrl}). | |
otherwise({redirectTo: '/'}); | |
}]) | |
//my controller | |
function GameListCtrl($scope, $http) { | |
$http.get('api/game').success(function(data) { | |
$scope.games = data; | |
}); | |
$scope.orderProp = 'date'; | |
} | |
//my index.html | |
<html lang="en" ng-app="cricketapp"> | |
<head> | |
... | |
<script src="lib/angular/angular.js"></script> | |
<script src="js/app.js"></script> | |
<script src="js/controllers.js"></script> | |
</head> | |
<body> | |
<div ng-view></div> | |
</body> | |
//and my pending games | |
<ul> | |
<li ng-repeat="game in games"> | |
<p>{{ game.slug }}</p> | |
<p>{{ game.date | date:'fullDate' }}</p> | |
</li> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment