添加空值

时间:2016-01-29 22:15:22

标签: javascript angularjs backand

由于某些原因,当我按下Add按钮时,我的后端会添加一个空值。我不知道原因...我试图通过它的回调中的console.log()调试它,它给了我输入的实际字符串....?有什么问题?

基本上如果您仍然感到困惑:它会添加值..但它会添加一个空字符串。这是一个待办事项

的index.html:

var vakken: [(String,[Int],[Int])]

App.js:

   <!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <link href="lib/ionic/css/ionic.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->
    <!-- Backand SDK for Angular -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    <script src="https://code.angularjs.org/1.4.9/angular.js"></script>
 <script src="//cdn.backand.net/backand/dist/1.8.2/backand.min.js"></script>
    <!-- ionic/angularjs js -->
    <script src="lib/ionic/js/ionic.bundle.js"></script>

    <!-- cordova script (this will be a 404 during development) -->
    <script src="cordova.js"></script>
    <!-- your app's js -->
    <script src="js/app.js"></script>
  </head>
  <body ng-app="starter" ng-controller = "AppCtrl">
    <ion-header-bar class="bar-positive">
    <h1 class="title">My Backand Todo List</h1>
  </ion-header-bar>

  <ion-content class="has-header">
    <input type="text" placeholder="New Todo" id = "todo" ng-model = "description"/>
    <input type = "button" ng-click = "create();" value = "ADD"/>
    <ion-list can-swipe="true">
       <ion-item ng-repeat="item in todos">
         {{item.name}}
         <ion-option-button class="button-assertive" ng-click="delete(item.id)">
           Delete
         </ion-option-button>
       </ion-item>
     </ion-list>



  </ion-content>

  </body>
</html>

0 个答案:

没有答案