Skip to main content
added 2 characters in body
Source Link
Deividi Cavarzan
  • 10.1k
  • 13
  • 68
  • 80

I have many many buttons in page and a input for user to enter color.

Is there a better way than below code?

<button ng-style="myStyles>style="myStyles">
<button ng-style="myStyles>style="myStyles">
.....
....

<input type="text" ng-modal="myStyles.color">

Can we generate a dynamic class like below?

<style>
 button {
     color : {{myStyles.color}}
 }
</style>

I have many many buttons in page and a input for user to enter color.

Is there a better way than below code?

<button ng-style="myStyles>
<button ng-style="myStyles>
.....
....

<input type="text" ng-modal="myStyles.color">

Can we generate a dynamic class like below?

<style>
 button {
     color : {{myStyles.color}}
 }
</style>

I have many many buttons in page and a input for user to enter color.

Is there a better way than below code?

<button ng-style="myStyles">
<button ng-style="myStyles">
.....
....

<input type="text" ng-modal="myStyles.color">

Can we generate a dynamic class like below?

<style>
 button {
     color : {{myStyles.color}}
 }
</style>
Source Link

How to add dynamic styles to many elements in Angular

I have many many buttons in page and a input for user to enter color.

Is there a better way than below code?

<button ng-style="myStyles>
<button ng-style="myStyles>
.....
....

<input type="text" ng-modal="myStyles.color">

Can we generate a dynamic class like below?

<style>
 button {
     color : {{myStyles.color}}
 }
</style>