Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Merge pull request #108 from theonion/change-article-watcher
Browse files Browse the repository at this point in the history
Speed up $digest for large articles
  • Loading branch information
kand committed Feb 23, 2016
2 parents f090ace + ad251d8 commit b8aec5a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/scripts/controllers/contentedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ angular.module('bulbsCmsApp')

// keep track of if article is dirty or not
$scope.articleIsDirty = false;
$scope.$watch('article', function () {
$scope.articleIsDirty = !angular.equals($scope.article, $scope.last_saved_article);
}, true);
$scope.$watch(function () {
return !angular.equals($scope.article, $scope.last_saved_article);
}, function (isDirty) {
$scope.articleIsDirty = isDirty;
});

$scope.$watch('articleIsDirty', function () {
if ($scope.articleIsDirty) {
Expand Down

0 comments on commit b8aec5a

Please sign in to comment.