2016-10-15 4 views
0

フラスコとsqlalchemyにanglejsとバックエンドapiビルドを使用するWebアプリケーションを作成しようとしています。問題は、json内のいくつかのキーにドットが含まれており、angularjsがこれを処理できないということです。問題は、location.nameフィールドにあります。 SQLALCHEMEY結合テーブルを使用して残りのAPIを持つAngularjs

この

は、APIからJSONで

{ "ブランド": "不明"、 "ID":6、 "location.name": "USB"、 "名前": "USBのverlengkabelの0.5メートル"、 "URI": "http://localhost:5000/items/6" }

そして、これは私の角度コントローラです:

10とHTMLページ

   <div ng-if="ctrl.result.class" ng-class="ctrl.result.class"> 
        {{ctrl.result.message}} 
       </div> 
       <form class="form-horizontal" role="form" ng-submit="ctrl.updateItem()"> 
        <div class="form-group"> 
        <label for="name" class="col-sm-2 control-label">Name</label> 
        <div class="col-sm-10"> 
        <input type="text" ng-model="ctrl.item.name" class="form-control" id="name" placeholder="name"/> 
        </div> 
       </div> 
       <div class="form-group"> 
        <label for="brand" class="col-sm-2 control-label">Brand</label> 
        <div class="col-sm-10"> 
        <input type="text" ng-model="ctrl.item.brand" class="form-control" id="brand" placeholder="brand" /> 
        </div> 
       </div> 
       <div class="form-group"> 
        <label for="location" class="col-sm-2 control-label">Location</label> 
        <div class="col-sm-10"> 
        <input type="text" ng-model="ctrl.location.name" class="form-control" id="location" placeholder="location" /> 
        </div> 
       </div> 
       <div class="form-group"> 
        <div class="col-sm-offset-2 col-sm-10"> 
        <input type="submit" class="btn btn-primary" value="Save"/> 
        </div> 
       </div> 

       </form> 

答えて

関連する問題