Hide Back button when there is no history on first load.

This commit is contained in:
Gunther Brunner
2014-10-02 16:51:48 +09:00
parent d0f6759266
commit d3ebab0c4b
2 changed files with 9 additions and 3 deletions

View File

@@ -1,6 +1,13 @@
module.exports =
function DocsCtrl($rootScope, $scope, $window, $location) {
function hasHistory() {
// TODO: watch this
return $window.history.length > 1
}
$scope.hasHistory = hasHistory()
$scope.goBack = function () {
$window.history.back()
}