使用AngularJs发布到Google电子表格

时间:2016-03-16 09:58:53

标签: angularjs post google-sheets

继本帖Load JSON in AngularJS App (loading google spreadsheet)之后如何将我的Angular应用程序中的数据发布到电子表格中?它甚至可以吗?

我已经创建了一个版本的应用程序,可以在本地更新数据,但现在想要切换到从外部源(谷歌电子表格 - 目前可用)中提取数据并发布对这个外部来源也是如此。

PS仅使用Google电子表格进行快速原型制作。

HTML表单,然后使用ng-submit更新控制器中的本地数组。

<form  name="reviewsForm" class="form-horizontal" ng-controller="newReviewController as newReviewCtrl" ng-submit="reviewsForm.$valid && newReviewCtrl.addScore(reviews)" novalidate>

<div class="form-group">
    <label for="type" class="col-xs-4 control-label hide">Review type</label>
    <div class="col-xs-6 select-menu">
        <select tabindex="" name="type" id="type" class="validate" ng-model="newReviewCtrl.reviews.type"  class="validate" required>
            <option value="" disabled selected>Review type</option>
            <option ng-repeat="type in types">{{type.name}}</option>
        </select>
    </div>
    <label for="reviewTitle" class="col-xs-4 control-label hide">Review title</label>
    <div class="col-xs-6">
        <input tabindex="" type="text" name="reviewTitle" ng-model="newReviewCtrl.reviews.name" class="validate" placeholder="Review title" required>
    </div>                                    
</div>

<div class="form-group">
    <label for="Description" class="col-xs-4 control-label hide">Description</label>
    <div class="col-xs-12">
        <input tabindex="" type="text" name="Description" ng-model="newReviewCtrl.reviews.desc" class="validate" placeholder="Description" required >
    </div>
</div>

<div class="form-group">
    <label for="Image" class="col-xs-4 control-label hide">Image url</label>
    <div class="col-xs-6">
        <input tabindex="" type="text" name="Image" ng-model="newReviewCtrl.reviews.imgUrl" class="validate" placeholder="Image url" required >
    </div>
    <label for="info" class="col-xs-4 control-label hide">More info url</label>
    <div class="col-xs-6">
        <input tabindex="" type="text" name="info" ng-model="newReviewCtrl.reviews.infoUrl" class="validate" placeholder="More info url" required >
    </div>                                    
</div>

<div class="form-group">
    <label for="date" class="col-xs-4 control-label hide">Date</label>
    <div class="col-xs-6">
        <input tabindex="" type="date" max="2020-01-01"  min="2015-01-01" name="date" ng-model="newReviewCtrl.reviews.date" class="validate" placeholder="YYYY-MM-DD"  required>
    </div>
    <div class="col-xs-6 text-right">
        <button tabindex="" type="submit" class="btn btn-block waves-effect waves-light green btn-add white-text" ng-show="reviewsForm.$valid" ng-click="newReviewCtrl.reviews.type='0'" id="add-submit" style="margin:0px;" data-toggle="collapse" data-target="#addReviewCollapse" aria-expanded="false" aria-controls="addReviewCollapse">
            Add
        </button>   
    </div>        
</div> 

现有数据数据的一部分示例

$scope.reviews = [
    {
        name: "The Force Awakens",
        imgUrl: 'img/theforceawakens.jpg',
        type:'Movie',
        desc: 'Amazeballs',
        infoUrl: '???',  
        date: new Date(2016, 02, 16, 16)
    }, 

我已将所有相同的信息添加到Google电子表格中并使用此帖子将该数据提取到我的页面Load JSON in AngularJS App (loading google spreadsheet),我现在也希望使用上述表单发布到该spreadhseet但不知道从哪里开始。

0 个答案:

没有答案