Created
May 20, 2015 18:39
-
-
Save yellow1912/e81a0ee8f9ccc5db00a2 to your computer and use it in GitHub Desktop.
bug report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="section" id="initial-directive"><h1>Initial directive<a class="headerlink" href="#initial-directive" title="Permalink to this headline">¶</a></h1><p>Located in <code class="docutils literal"><span class="pre">nilead.common</span></code></p><div class="section" id="purpose"><h2>Purpose<a class="headerlink" href="#purpose" title="Permalink to this headline">¶</a></h2><p>Automatic initialize value to angular model through <code class="docutils literal"><span class="pre">ngModel</span></code></p></div><div class="section" id="usage"><h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2><p>Apps that use this directive should include <code class="docutils literal"><span class="pre">nilead.common</span></code></p><div class="highlight-html"><div class="highlight"><pre>Restrict: ARequirements: [ngModel]</pre></div></div><div class="section" id="syntax"><h3>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h3><div class="highlight-html"><div class="highlight"><pre>nl-initialnl-initial="Some Thing"</pre></div></div><p>If the directive defined with some value, that value will bind into your model</p><p><strong>Example</strong></p><div class="highlight-html"><div class="highlight"><pre><span class="c"><!-- After this element rendered, your model ``product.name`` should be "Some Thing" --></span><span class="nt"><input</span> <span class="na">type=</span><span class="s">"text"</span> <span class="na">data-nl-initial=</span><span class="s">"Some Thing"</span> <span class="na">data-ng-model=</span><span class="s">"product.name"</span><span class="nt">></span></pre></div></div><p>If the directive define without any value and the element has a value, that value will bind into your model</p><div class="highlight-html"><div class="highlight"><pre><span class="c"><!-- After this element rendered, your model ``product.name`` should be "Some Value" --></span><span class="nt"><input</span> <span class="na">type=</span><span class="s">"text"</span> <span class="na">data-nl-initial</span> <span class="na">data-ng-model=</span><span class="s">"product.name"</span> <span class="na">value=</span><span class="s">"Some Value"</span><span class="nt">></span></pre></div></div></div></div></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment