dev verma
dev verma

Reputation: 777

Toggle button not displayed when using md-switch angular material directive

// i have created switchDemo1 module and controller SwitchDemoCtrl. // scope data object is defined with initial value.

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>

Upvotes: 0

Views: 1098

Answers (1)

Sajeetharan
Sajeetharan

Reputation: 222720

<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

Upvotes: 2

Related Questions