UNPKG

knowhow-server

Version:

A personal workflow engine that can manage and use any network connected host

52 lines (50 loc) 2.62 kB
<a href="http://github.com/angular/angular.js/edit/master/docs/content/cookbook/helloworld.ngdoc" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable=""></code> <div><span class="hint"></span> </div> </h1> <div><div class="cookbook-page cookbook-hello-world-page"><h3 id="source">Source</h3> <div source-edit="" source-edit-deps="angular.js script.js" source-edit-html="index.html-195" source-edit-css="" source-edit-js="script.js-194" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-196" source-edit-protractor=""></div> <div class="tabbable"><div class="tab-pane" title="index.html"> <pre class="prettyprint linenums" ng-set-text="index.html-195" ng-html-wrap=" angular.js script.js"></pre> <script type="text/ng-template" id="index.html-195"> <div ng-controller="HelloCntl"> Your name: <input type="text" ng-model="name"/> <hr/> Hello {{name || "World"}}! </div> </script> </div> <div class="tab-pane" title="script.js"> <pre class="prettyprint linenums" ng-set-text="script.js-194"></pre> <script type="text/ng-template" id="script.js-194"> function HelloCntl($scope) { $scope.name = 'World'; } </script> </div> <div class="tab-pane" title="ngScenario e2e test"> <pre class="prettyprint linenums" ng-set-text="scenario.js-196"></pre> <script type="text/ng-template" id="scenario.js-196"> it('should change the binding when user enters text', function() { expect(binding('name')).toEqual('World'); input('name').enter('angular'); expect(binding('name')).toEqual('angular'); }); </script> </div> </div><h3 id="demo">Demo</h3> <div class="well doc-example-live animate-container" ng-embed-app="" ng-set-html="index.html-195" ng-eval-javascript="script.js-194"></div> <h2 id="things-to-notice">Things to notice</h2> <p>Take a look through the source and note:</p> <ul> <li>The script tag that <a href="guide/bootstrap">bootstraps</a> the Angular environment.</li> <li>The text <a href="api/ng.directive:input"><code>input form control</code></a> which is bound to the greeting name text.</li> <li>There is no need for listener registration and event firing on change events.</li> <li>The implicit presence of the <code>name</code> variable which is in the root <a href="api/ng.$rootScope.Scope"><code>scope</code></a>.</li> <li>The double curly brace <code>{{markup}}</code>, which binds the name variable to the greeting text.</li> <li>The concept of <a href="guide/databinding">data binding</a>, which reflects any changes to the input field in the greeting text.</li> </ul> </div></div>