From 3410f65e790a81d457b4f4601a1e760a6f8ede5e Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski Date: Wed, 16 Oct 2013 15:15:21 +0200 Subject: perf(jqLite): implement and use the `empty` method in place of `html(‘’)` jQuery's elem.html('') is way slower than elem.empty(). As clearing element contents happens quite often in certain scenarios, switching to using .empty() provides a significant performance boost when using Angular with jQuery. Closes #4457 --- docs/content/guide/dev_guide.unit-testing.ngdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/content/guide') diff --git a/docs/content/guide/dev_guide.unit-testing.ngdoc b/docs/content/guide/dev_guide.unit-testing.ngdoc index 9d3d9765..e15edeb7 100644 --- a/docs/content/guide/dev_guide.unit-testing.ngdoc +++ b/docs/content/guide/dev_guide.unit-testing.ngdoc @@ -222,7 +222,7 @@ var pc = new PasswordCtrl(); input.val('abc'); pc.grade(); expect(span.text()).toEqual('weak'); -$('body').html(''); +$('body').empty(); In angular the controllers are strictly separated from the DOM manipulation logic and this results in -- cgit v1.2.3