AngularJS : md-button // 我可以在 ng-button 和 ng-click 中有 2 行和 2 种字体大小吗?

AngularJS : md-button // Can I have 2 lines, and 2 font sizes in an ng-button, with an ng-click?

我想要一个按钮(在 NodeRed 中,使用 ui 模板),按钮内部有一个标题,例如字体 10,然后在中断处,以及一个更大字体的值,但是仍在按钮中?

据我所知,我只能为一个按钮声明一次文本大小,他们有什么办法吗?

谢谢smooth_atonal_sound!我现在差不多了,仍然需要 ng-click 方面的帮助,请参阅下面的代码(改编自 Scargill),ng-click 指令不起作用,我该如何解决?

<style>
  .filled { 
      height: 100% !important;
      padding: 0 !important;
      margin: 0 !important; }
      
  .nr-dashboard-template {
      padding: 0;
      margin: 0;
      overflow-x: hidden;
      overflow-y: hidden; }
      
  .rounded {
  border-radius: 7% 7% 7% 7%; }
   
   .fontbig {
  font-size: 28px;  }
   
   .fontsmall {
  font-size: 14px;  }
  
  .tolowercase {
    text-transform: lowercase;  }
    
  .tocapitalize {
    text-transform: capitalize; }

  .backgroundgreen {background: #73AD21;}
    
</style>



<script>
    $('.vibrate').on('click', function() {
      navigator.vibrate(100);
    });
     
    function restore_bg(x,y) {
                $(this).css("background-color", x);
        };
 
    $('.touched').on('mousedown', function() {
        var x= $(this).css("background-color");
        // $(this).css("background-color", "yellow");
        navigator.vibrate(80);
    });
</script>

<md-button 
    class="alerted filled touched rounded tocapitalize vibrate">
    <span style="fontsmall" {{msg.topic}}> <br><br>
    <span style="fontbig"{{msg.val}}>
    <ng-click="send({payload: 'test it...'})" >
</md-button>

是的,你可以。您可以像对待任何其他元素一样设置它的样式。

`<md-button>
    <span class="size-1">Primary Size</p>
    <span class="size-2">Secondary Size</p>
</md-button>`

`.size-1 {
    font-size: 10px;
}
.size-2 {
    font-size: 12px;
}`

这是一个工作版本,排序为:

<md-button 
   class="alerted filled touched rounded tocapitalize vibrate"
   style="background-size: 100% 100%; background-repeat: no-repeat;"
   ng-click="send({payload: 'Red Button'})">
   <span class="fontsmall" >{{msg.topic}}</span><br><br>
   <span class="fontbig">{{msg.val}}</span>
</md-button>