diff --git a/contribution/zeppelinweb/goodPracticeGuide01.md b/contribution/zeppelinweb/goodPracticeGuide01.md index 317bd0f5ac4..d486208731b 100644 --- a/contribution/zeppelinweb/goodPracticeGuide01.md +++ b/contribution/zeppelinweb/goodPracticeGuide01.md @@ -25,8 +25,8 @@ limitations under the License. We should have only one Angular Component per file, and it should look like this: ``` +'use strict'; (function() { - 'use strict'; angular.module('zeppelinWebApp').controller('HomeCtrl', HomeCtrl); diff --git a/contribution/zeppelinweb/goodPracticeGuide03.md b/contribution/zeppelinweb/goodPracticeGuide03.md index 836271ffe81..09ccd8f6be3 100644 --- a/contribution/zeppelinweb/goodPracticeGuide03.md +++ b/contribution/zeppelinweb/goodPracticeGuide03.md @@ -102,7 +102,7 @@ Now let's see how we can use it inside our `.html` view in normal situations. ```
-
{{ newCtrl.publicVariable }}
+
{{ "{{newCtrl.publicVariable"}}}}
``` @@ -126,7 +126,7 @@ Which will leave the `.html` view without any `ng-controller` property. ```
-
{{ newCtrl.publicVariable }}
+
{{ "{{newCtrl.publicVariable"}}}}
``` diff --git a/contribution/zeppelinweb/goodPracticeGuide04.md b/contribution/zeppelinweb/goodPracticeGuide04.md new file mode 100644 index 00000000000..ec5286e6f1c --- /dev/null +++ b/contribution/zeppelinweb/goodPracticeGuide04.md @@ -0,0 +1,46 @@ +--- +layout: sideMenu +title: "4 - Using ng-bind" +description: "" +group: nav-contrib-front +menu: nav-contrib-front +--- + + +# Performance Gain Using ng-bind + +
+We recommend the usage of `ng-bind` in your views. + +It allows some performance improvements compared to the usual `{{ "{{ " }}}}` syntax, without adding too much code complexity. + +Your code would then look like: + +``` +
+``` + +Instead of: + +``` +
+{{ "{{home.myValue"}}}} +
+``` + +#### Learn More + +The topic has been discussed a lot, and you can follow some of these discussions [here](https://github.com/toddmotto/angular-styleguide/issues/41) or +[there](http://stackoverflow.com/questions/27097006/angularjs-why-is-ng-bind-faster-than-expressions).