0

// 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>

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

6 Comments

Toogle button is not displayed only 'Switch 1: true' text display on page.
@devverma no it displays, check the demo
Yes,it occur only on my side.Is it require jquery?
@devverma you got it sorted?
Yes,Actually i missed to include DI 'ngMaterial' my code.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.