Make simple <md-chip> work without <md-chips> in AngularJS Material?
I’m using AngularJS Material v1.1.1.
I’m finding a way to use simple <md-chip>
without <md-chips>
.
Here is an easy way in Vue Material: https://codesandbox.io/s/lyoqv4l0z?module=App.vue
1 | <md-chip class="md-primary" md-deletable>Deletable</md-chip> |
But I can not find the similiar way in AngularJS Material document.
https://material.angularjs.org/latest/api/directive/mdChip
Here is my code:
https://codepen.io/iMaeGoo/pen/EJaaqp
1 | <body ng-app="myApp" ng-controller="AppCtrl"> |
1 | angular.module('myApp',['ngMaterial']).controller('AppCtrl', function($scope) { |
One workaround is to rewrite CSS.
1 | md-chips { |
1 | <md-chips class="chips" ng-model="chips" md-max-chips="1"> |
1 | angular.module('myApp', ['ngMaterial']).controller('AppCtrl', function($scope) { |
See: https://codepen.io/iMaeGoo/pen/BEyKem
The chip is still in chips component. It is not a good idea.
Feel free to answer if you have better idea!
https://stackoverflow.com/questions/55455225/how-to-make-simple-md-chip-work-without-md-chips-in-angularjs-material
Make simple <md-chip> work without <md-chips> in AngularJS Material?