簡體   English   中英

頁面加載時顯示離子中動態添加的字段

[英]On page load show dynamically added fields in ionic

我設計了使用ionic和angularjs的求職門戶應用程序。 在其中我有一個頁面名稱skill.html。 哪個代碼如下

<ion-view>
 <ion-nav-title>
    <span>Skills</span>
  </ion-nav-title>
  <ion-content>

    <div class="row responsive-sm" ng-repeat="item in inputs">
       <div class="col col-center">            
            <div class="list list-inset">
              <span class="input-label">Skill:</span>
              <input type="text" placeholder="Enter Skills" id="skill" name="skill" ng-model="skills[$index]">
            </div>  

           <div class="list list-inset">
              <span class="input-label">Proficiency:</span>
               <select ng-model="proficiency[$index]">
                    <option value="Beginner">Beginner</option>  
                    <option value="Intermediate">Intermediate</option>  
                    <option value="Advanced">Advanced</option>              
              </select> 
            </div>             

       </div>
     </div>  
     <div class="row responsive-sm">
       <div class="col">
         <div class="list list-inset">
            <button class="button button-block button-positive"  ng-click="submit_skill_details()">Submit</button>
          </div>
       </div>
     </div>
     <div class="row">
       <div class="col col-50">
         <button class="button button-block button-assertive" ng-click="addskills()">Add Skills</button>
         </div>
         <div class="col col-50">
         <button class="button button-block button-royal" ng-click="deleteskills()">Delete Skills</button>
         </div>
       </div>

  </ion-content>
</ion-view>

提交技能對我來說很好。我可以在登錄時顯示提交的技能。 我必須單擊“添加技能”按鈕以顯示已提交的技能,但我想在頁面加載時顯示它。 例如:如果用戶僅提交了html之類的一項技能,則在頁面加載時,它應顯示一行,且輸入字段包含html。 如果用戶使用初學者提交html並單擊添加技能按鈕以添加具有熟練程度的下一個技能css,則當用戶重新登錄並轉到技能頁面時,它應該顯示兩行。 一行用於html,另一行用於css。

 <div>
                <label>Drop Down</label>
                 <select id = "prof" ng-model="newPayment.prof">
                <option value="Beginner">Beginner</option>  
                <option value="Intermediate">Intermediate</option>  
                <option value="Advanced">Advanced</option>              
          </select> 
            </div>

數據就像是:$ scope.payments = [{id:1,prof:'Beginner'},{id:2,prof:'Beginner'},{id:3,prof:'Intermediate'}];

當我單擊任何現有技能時,數據已經在下拉列表中填充並可見。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM