dubdiff/client/app/compare/show/show.controller.js
Adam Brown b49041db43 simplify interface
remove authentication, document management from front-end
2015-04-12 02:42:47 -04:00

36 lines
970 B
JavaScript

'use strict';
angular.module('markdownFormatWdiffApp')
.controller('CompareShowCtrl', function ($scope, $routeParams, $http) {
$scope.wdiff = {};
$scope.before = {};
$scope.after = {};
$scope.isShowWdiff = true;
// if routeParams specifies a user, restrict the query to that user
var path = '/api/compare/wdiff/' + $routeParams.id;
$http.get(path).success(function(comparison) {
$scope.wdiff = comparison.wdiff;
$scope.before = comparison.a;
$scope.after = comparison.b;
});
$scope.showBefore = function() {
$scope.isShowBefore = true;
$scope.isShowAfter = false;
$scope.isShowWdiff = false;
}
$scope.showAfter = function() {
$scope.isShowBefore = false;
$scope.isShowAfter = true;
$scope.isShowWdiff = false;
}
$scope.showWdiff = function() {
$scope.isShowBefore = false;
$scope.isShowAfter = false;
$scope.isShowWdiff = true;
}
})