Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ACE60200B9B for ; Wed, 28 Sep 2016 03:44:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AB61E160AE6; Wed, 28 Sep 2016 01:44:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 86F9A160AD2 for ; Wed, 28 Sep 2016 03:44:21 +0200 (CEST) Received: (qmail 51975 invoked by uid 500); 28 Sep 2016 01:44:20 -0000 Mailing-List: contact commits-help@zeppelin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zeppelin.apache.org Delivered-To: mailing list commits@zeppelin.apache.org Received: (qmail 51964 invoked by uid 99); 28 Sep 2016 01:44:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2016 01:44:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 524F41809D8 for ; Wed, 28 Sep 2016 01:44:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ATX9L2c53PM8 for ; Wed, 28 Sep 2016 01:44:17 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id 5F4535FADE for ; Wed, 28 Sep 2016 01:44:16 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 648A5E0147 for ; Wed, 28 Sep 2016 01:44:15 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 92E1F3A027B for ; Wed, 28 Sep 2016 01:44:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1762596 - in /zeppelin/site/contribution: ./ zeppelinweb/ Date: Wed, 28 Sep 2016 01:44:12 -0000 To: commits@zeppelin.apache.org From: corneadoug@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160928014413.92E1F3A027B@svn01-us-west.apache.org> archived-at: Wed, 28 Sep 2016 01:44:22 -0000 Author: corneadoug Date: Wed Sep 28 01:44:12 2016 New Revision: 1762596 URL: http://svn.apache.org/viewvc?rev=1762596&view=rev Log: Add ZeppelinWeb GoodPracticeGuide 04 Added: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide04.html Modified: zeppelin/site/contribution/contributions.html zeppelin/site/contribution/documentation.html zeppelin/site/contribution/webapplication.html zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html Modified: zeppelin/site/contribution/contributions.html URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/contributions.html?rev=1762596&r1=1762595&r2=1762596&view=diff ============================================================================== --- zeppelin/site/contribution/contributions.html (original) +++ zeppelin/site/contribution/contributions.html Wed Sep 28 01:44:12 2016 @@ -124,6 +124,12 @@ + + + + + + @@ -263,6 +269,12 @@ + + + + + + Modified: zeppelin/site/contribution/documentation.html URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/documentation.html?rev=1762596&r1=1762595&r2=1762596&view=diff ============================================================================== --- zeppelin/site/contribution/documentation.html (original) +++ zeppelin/site/contribution/documentation.html Wed Sep 28 01:44:12 2016 @@ -124,6 +124,12 @@ + + + + + + @@ -263,6 +269,12 @@ + + + + + + Modified: zeppelin/site/contribution/webapplication.html URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/webapplication.html?rev=1762596&r1=1762595&r2=1762596&view=diff ============================================================================== --- zeppelin/site/contribution/webapplication.html (original) +++ zeppelin/site/contribution/webapplication.html Wed Sep 28 01:44:12 2016 @@ -124,6 +124,12 @@ + + + + + + @@ -290,6 +296,16 @@ + + + + + + +
  • 4 - Using ng-bind
  • + + + Modified: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html?rev=1762596&r1=1762595&r2=1762596&view=diff ============================================================================== --- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html (original) +++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html Wed Sep 28 01:44:12 2016 @@ -124,6 +124,12 @@ + + + + + + @@ -294,6 +300,16 @@ + + +
  • 4 - Using ng-bind
  • + + + + + + + @@ -374,8 +390,8 @@ limitations under the License.


    We should have only one Angular Component per file, and it should look like this:

    -
    (function() {
    -  'use strict';
    +
    'use strict';
    +(function() {
     
       angular.module('zeppelinWebApp').controller('HomeCtrl', HomeCtrl);
     
    
    Modified: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html
    URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html?rev=1762596&r1=1762595&r2=1762596&view=diff
    ==============================================================================
    --- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html (original)
    +++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html Wed Sep 28 01:44:12 2016
    @@ -124,6 +124,12 @@
       
         
           
    +        
    +      
    +    
    +  
    +    
    +      
         
       
         
    @@ -290,6 +296,16 @@
               
             
           
    +    
    +  
    +    
    +      
    +        
    +          
    +            
  • 4 - Using ng-bind
  • + + + Modified: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html?rev=1762596&r1=1762595&r2=1762596&view=diff ============================================================================== --- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html (original) +++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html Wed Sep 28 01:44:12 2016 @@ -124,6 +124,12 @@ + + + + + + @@ -294,6 +300,16 @@ + + +
  • 4 - Using ng-bind
  • + + + + + + + @@ -447,7 +463,7 @@ Our main rule regarding writing a contro

    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"></div>
    +  <div ng-click="newCtrl.myControllerPublicFunction">{{newCtrl.publicVariable}}</div>
     </div>
     

    Using the controller in a page

    @@ -465,7 +481,7 @@ Our main rule regarding writing a contro

    Which will leave the .html view without any ng-controller property.

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

    The rules in detail

    Added: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide04.html URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide04.html?rev=1762596&view=auto ============================================================================== --- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide04.html (added) +++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide04.html Wed Sep 28 01:44:12 2016 @@ -0,0 +1,441 @@ + + + + + + + 4 - Using ng-bind + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • 1 - Defining Components
  • + + + + + + + + + +
  • 2 - Event Dispatching
  • + + + + + + + + + +
  • 3 - Making A Controller
  • + + + + + + + + + +
  • 4 - Using ng-bind
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • Web Application
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + +

    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:

    +
    <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 or +there.

    + +
    + +
    + + +
    +
    + +
    +
    + + + + + + + + + + + + +