snipt

Ctrl+h for KB shortcuts

Text only

ng-options

<select ng-model="contact.reason"
                  ng-options="reason as reason.name for reason in reasons track by reason.id"
                  name="reason"
                  required>
          </select>
          
           <select ng-model="application.requested_loan_amount"
                    ng-options="item.value as item.label for item in requested_loan_amounts"
                    name="requested_loan_amount"
                    required>
            </select>
https://snipt.net/embed/34b59817d93f881818f3912103bc497d/
/raw/34b59817d93f881818f3912103bc497d/
34b59817d93f881818f3912103bc497d
text
Text only
12
2019-07-15T19:55:48
True
False
False
/api/public/snipt/147297/
ng-options
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>&lt;select ng-model=&quot;contact.reason&quot; </span><span id="L-2"><a name="L-2"></a> ng-options=&quot;reason as reason.name for reason in reasons track by reason.id&quot; </span><span id="L-3"><a name="L-3"></a> name=&quot;reason&quot; </span><span id="L-4"><a name="L-4"></a> required&gt; </span><span id="L-5"><a name="L-5"></a> &lt;/select&gt; </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a> &lt;select ng-model=&quot;application.requested_loan_amount&quot; </span><span id="L-8"><a name="L-8"></a> ng-options=&quot;item.value as item.label for item in requested_loan_amounts&quot; </span><span id="L-9"><a name="L-9"></a> name=&quot;requested_loan_amount&quot; </span><span id="L-10"><a name="L-10"></a> required&gt; </span><span id="L-11"><a name="L-11"></a> &lt;/select&gt; </span></pre></div> </td></tr></table>
angular, ionic
--- 
+++ 
@@ -2,4 +2,10 @@
                   ng-options="reason as reason.name for reason in reasons track by reason.id"
                   name="reason"
                   required>
-          </select>+          </select>
+          
+           <select ng-model="application.requested_loan_amount"
+                    ng-options="item.value as item.label for item in requested_loan_amounts"
+                    name="requested_loan_amount"
+                    required>
+            </select>
1
2
3
4
5
6
7
8
--- 
+++ 
@@ -0,0 +1,5 @@
+<select ng-model="contact.reason"
+                  ng-options="reason as reason.name for reason in reasons track by reason.id"
+                  name="reason"
+                  required>
+          </select>