国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

angular.js - AngularJs 級聯(lián)
黃舟
黃舟 2017-05-15 16:54:06
0
1
843

Angular.js 的版本是1.2.5
要實現(xiàn)的功能是 Select 三級聯(lián)動。
出現(xiàn)的問題是:選擇完第二級(國家)的時候,第三級(城市)沒有出現(xiàn)。
請大俠們指導(dǎo)!

-- HTML代碼 --

<p ng-app="app" ng-controller="global">
    <select ng-model="ihg" ng-options="ihg.text for ihg in g">
        <option value="">-- 洲際 --</option>
    </select>
    <select ng-if="ihg.nat" ng-model="nat" ng-options="nat.text for nat in ihg.nat">
        <option value="">-- 國家 --</option>
    </select>
    <select ng-if="nat.cities" ng-model="city" ng-options="city.text for city in nat.cities">
        <option value="">-- 城市 --</option>
    </select>
</p>

-- JS代碼 --

var app=angular.module("app",[]);
app.controller("global",['$scope',function($scope){
    $scope.g=[
        {text:"亞洲",nat:[
            {text:"中國",cities:[{text:"北京"}]},
            {text:"巴林",cities:[]},
            {text:"韓國",cities:[{text:"首爾"}]},
            {text:"黎巴嫩",cities:[]},
            {text:"東帝汶",cities:[]},
            {text:"尼泊爾",cities:[]},
            {text:"泰國",cities:[{text:"曼谷"}]},
            {text:"巴基斯坦",cities:[{text:"伊斯蘭堡"}]}
        ]},
        {text:"歐洲",nat:[
            {text:"德國",cities:[]},
            {text:"英國",cities:[]}
        ]},
        {text:"北美洲"},
        {text:"南美洲"},
        {text:"非洲"},
        {text:"大洋洲"},
        {text:"南極洲"}
    ]
}]);
黃舟
黃舟

人生最曼妙的風(fēng)景,竟是內(nèi)心的淡定與從容!

Antworte allen(1)
為情所困

ng-if改為ng-show

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage