尝试使用参数时,无法在角度材料mdSelect上禁用“multiple”属性

时间:2016-09-07 09:46:17

标签: angularjs angular-material

尝试使用参数时,无法在角度材质mdSelect上禁用<!DOCTYPE> <html> <head> <title>Sample DYMO Label Plug-In</title> <script src="http://labelwriter.com/software/dls/sdk/js/DYMO.Label.Framework.latest.js"></script> <!-- your script second --> <script> function OnLoad() { //GetCurrentPlugin(); GetDYMOPrinters(); //GetPaperTray(); //GetMRUList(); //GetObjectNames(); //GetLabelImage(); } function GetDYMOPrinters() { // alert(" Testing 1"); var printers = dymo.label.framework.getPrinters(); if (printers.length == 0) throw "No DYMO printers are installed. Install DYMO printers."; //alert("dfdsfd"); var printerName = ""; for (var i = 0; i < printers.length; ++i) { var printer = printers[i]; if (printer.printerType == "LabelWriterPrinter") { printerName = printer.name; break; } } //var label = dymo.label.framework.open("MyText.label"); label.SetObjectText("Text", "John Smith"); //alert(" Testing 2"); // Here this alert also not working . label.print("DYMO LabelWriter 310"); } </script> </head> <body onload="OnLoad()"><form action="" method="post" id="DYMOLabel"> <center> <h2>DYMO Label Example</h2> <input type=button value="Get DYMO Printers" onClick="GetDYMOPrinters()"> </center> </form> </body> </html> 属性。如果我使用常量,它可以工作:

multiple

但是,如果我尝试使用范围变量,则不会: HTML:

<md-select ng-model="size"
           multiple="false">

JS:

<md-select ng-model="size"
           multiple="isMultiValue">

实施例: http://codepen.io/anon/pen/wzaGKd?editors=1010#anon-login

1 个答案:

答案 0 :(得分:0)

使用ng-multiple代替

<md-select ng-model="size"
       ng-multiple="isMultiValue">

demo