Created
January 31, 2014 09:25
-
-
Save jeamland/8728932 to your computer and use it in GitHub Desktop.
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
"use strict"; | |
var diffViewerApp = angular.module('diffViewerApp', ['ngRoute']); | |
diffViewerApp.config(function ($routeProvider, $locationProvider) { | |
$routeProvider.when('/', { | |
templateUrl: 'dir.html', | |
controller: 'DiffViewerCtrl' | |
}); | |
$routeProvider.when('/:dirPath/', { | |
templateUrl: 'dir.html', | |
controller: 'DiffViewerCtrl' | |
}); | |
$locationProvider.html5mode(true); | |
}); | |
diffViewerApp.controller('DiffViewerCtrl', function ($scope, $http, $window) { | |
console.log($window.location.pathname); | |
$http.get('/data' + $window.location.pathname). | |
success(function (data, status, headers, config) { | |
$scope.entries = data.entries; | |
console.log(data); | |
}) | |
.error(function (data, status, headers, config) { | |
alert("Unable to load data."); | |
console.error(status); | |
}); | |
$scope.entries = []; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment