2016-11-30 24 views
0

//我已創建switchDemo1模塊和控制器SwitchDemoCtrl。 //範圍數據對象用初始值定義。使用md-switch角度材質指令時不顯示切換按鈕

angular.module('switchDemo1', ['ngMaterial']) 
.controller('SwitchDemoCtrl', function($scope) { 
    $scope.data = { 
    cb1: true, 
    cb4: true, 
    cb5: false 
    }; 

// code in view 
    <md-switch ng-model="data.cb1" aria-label="Switch 1"> 
      Switch 1: {{ data.cb1 }} 
    </md-switch> 

回答

2
<body ng-controller="SwitchDemoCtrl" layout="row" layout-fill layout-align="space-around center"> 
    <md-switch ng-model="data.cb1" aria-label="Switch 1"> 
    Switch 1: {{ data.cb1 }} 
    </md-switch> 
</body> 

DEMO

+0

的toogle按鈕是不是隻顯示 '交換機1:真正的' 頁面上的文本顯示。 –

+0

@devverma沒有它顯示,檢查演示 – Sajeetharan

+0

是的,它只發生在我身邊。它需要jQuery嗎? –