2016-11-08 5 views

Antwort

2

Es scheint nicht möglich, mit der md-colors Richtlinie aber man kann es programmatisch tun - CodePen

Markup

<div ng-controller="AppCtrl as ctrl" ng-cloak="" ng-app="MyApp" layout-fill layout-padding layout="column"> 
    <div style="background: linear-gradient({{ctrl.color1}}, {{ctrl.color2}})" flex></div> 
</div> 

JS

angular.module('MyApp',['ngMaterial']) 

.controller('AppCtrl', function($mdColors) { 
    this.color1 = $mdColors.getThemeColor('primary-600'); 
    this.color2 = $mdColors.getThemeColor('primary-100'); 
}); 

Beachten Sie, dass dies nicht mit IE funktioniert. Vom docs:

enter image description here

+0

Dank, das funktioniert gut. – opendave

Verwandte Themen