Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contribution/zeppelinweb/goodPracticeGuide01.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions contribution/zeppelinweb/goodPracticeGuide03.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Now let's see how we can use it inside our `.html` view in normal situations.

```
<div ng-controller="myNewController as newCtrl">
<div ng-click="newCtrl.myControllerPublicFunction">{{ newCtrl.publicVariable }}</div>
<div ng-click="newCtrl.myControllerPublicFunction">{{ "{{newCtrl.publicVariable"}}}}</div>
</div>
```

Expand All @@ -126,7 +126,7 @@ Which will leave the `.html` view without any `ng-controller` property.

```
<div>
<div ng-click="newCtrl.myControllerPublicFunction">{{ newCtrl.publicVariable }}</div>
<div ng-click="newCtrl.myControllerPublicFunction">{{ "{{newCtrl.publicVariable"}}}}</div>
</div>
```

Expand Down
46 changes: 46 additions & 0 deletions contribution/zeppelinweb/goodPracticeGuide04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: sideMenu
title: "4 - Using ng-bind"
description: ""
group: nav-contrib-front
menu: nav-contrib-front
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Performance Gain Using ng-bind

<br/>
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:

```
<div ng-bing='home.myValue'></div>
```

Instead of:

```
<div>
{{ "{{home.myValue"}}}}
</div>
```

#### 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).