<ANY dynamic-styling="{string}">
...
</ANY>
Param | Type | Details |
---|---|---|
dynamicStyling | string | separated string of styles to apply to the element |
<layout:box dynamic-styling="{{styles}}">
<button styling="button" ng-click="toggleStyles()">Toggle box styling</button>
</layout:box>
angular.module('lightning')
roller('ExampleController', ['$scope', function($scope) {
$scope.styles = 'bg-raspberry text-raspberry-dark';
$scope.toggleStyles = function () {
if ($scope.styles == 'bg-raspberry text-raspberry-dark') {
$scope.styles = 'bg-sunflower text-sunflower-dark';
} else {
$scope.styles = 'bg-raspberry text-raspberry-dark';
}
};
}]);
Was this page helpful?