最新国产好看的视频,伊人天堂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)論

县级市| 岳西县| 荆门市| 辽中县| 夏邑县| 永州市| 古浪县| 岳普湖县| 北宁市| 湖北省| 乌鲁木齐县| 霍林郭勒市| 崇义县| 苍山县| 郯城县| 凯里市| 新蔡县| 嘉鱼县| 延庆县| 霍山县| 尖扎县| 绵阳市| 松阳县| 体育| 湘乡市| 东乌珠穆沁旗| 台湾省| 饶平县| 台中县| 崇信县| 中卫市| 富阳市| 红安县| 砀山县| 中超| 濮阳市| 日喀则市| 临邑县| 淮滨县| 山西省| 手游|