最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

angularjs的select使用及默認(rèn)選中設(shè)置

 更新時(shí)間:2017年04月08日 15:45:46   作者:stoneuu  
本篇文章主要介紹了angularjs的select使用及默認(rèn)選中設(shè)置,非常具有實(shí)用價(jià)值,需要的朋友可以參考下

我最近在研究angularjs學(xué)習(xí)的道路上,那么今天也算個(gè)學(xué)習(xí)筆記吧!

1 ng-model="standardCourse.showHours"代替name

2 ng-selected = "1"代替selected="selected",但問(wèn)題是select下會(huì)多出一個(gè)無(wú)用的option

3 在數(shù)據(jù)準(zhǔn)備時(shí)設(shè)置,$scope.standardCourse.showHours= '1';

解決多出的一個(gè)無(wú)用的option

<label for="_sel_show_hours">是否顯示課時(shí)數(shù)</label>

<select id="sel_show_hours" ng-model="standardCourse.showHours" >

<option value="1" ng-selected = "1">顯示</option>

<option value="0">不顯示</option>
</select> 

radio也是 ng-checked="1",也需要準(zhǔn)備數(shù)據(jù)時(shí)設(shè)置默認(rèn)值

準(zhǔn)備數(shù)據(jù)參考

$stateProvider.state('home.standardCourseAdd', {

    url: "/standardCourse/add",

    templateUrl: "/partials/ace/standardCourse/add.html",

    controller: function ($rootScope, $http, $scope, $location, $anchorScroll, $stateParams, $state, $timeout, $compile, Upload) {

      fnPost($scope, $state, $http, {'name': ''}, '/standardCourse/toAdd.do', function (success, data) {

        $scope.standardCourse = data.entity;

        $scope.standardCourse.showHours= '1';
      }); 

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

牟定县| 陇西县| 宁国市| 九龙城区| 满城县| 翁牛特旗| 即墨市| 双鸭山市| 高州市| 许昌县| 合阳县| 澄城县| 祥云县| 和平县| 台东县| 黄浦区| 黔西| 昭通市| 汨罗市| 凤台县| 公安县| 安陆市| 镇江市| 固原市| 正宁县| 荥阳市| 章丘市| 佛学| 五指山市| 东平县| 兴义市| 疏勒县| 乐清市| 大竹县| 乡宁县| 资兴市| 吐鲁番市| 惠州市| 康乐县| 普兰店市| 夹江县|