Angular 1.6.4 md-colors directive issue

I cannot add a directive md-colors

with mine md-fab

. md-fab

has a default color accent-A200

and I cannot change it with my custom theme. I don't want to use regular CSS instead md-colors

.

Here's the documentation for md-color: https://material.angularjs.org/1.1.0/api/directive/mdColors

Everything works with my theme.

Here's the documentation for the angular topic: https://material.angularjs.org/1.1.0/Theming/03_configuring_a_theme

What am I doing wrong?

I am unable to provide my entire application in JSFiddle / Plunker. Below is some piece of code. Tell me if you need more.

Thanks guys:)

HTML part

<div md-colors="{background-color: 'rouge-A100'}" class="ajouter-membre-container">
    <md-button href=""  class="md-fab md-mini md-warn md-fab--equipe"> 
       <md-icon md-svg-src="/img/icones/add.svg"></md-icon>
    </md-button>
</div>

      

Thematic part

$mdThemingProvider.definePalette('rouge', {
        '50': 'fde4e6',
        '100': 'fabbc1',
        '200': 'f68e97',
        '300': 'f2606d',
        '400': 'f03e4e',
        '500': 'ed1c2f',
        '600': 'eb192a',
        '700': 'e81423',
        '800': 'e5111d',
        '900': 'e00912',
        'A100': 'ffffff',
        'A200': 'ffd7d8',
        'A400': 'ffa4a6',
        'A700': 'ff8b8d',
        'contrastDefaultColor': 'light'

    });
    $mdThemingProvider.theme('myTheme')
        .accentPalette('rouge')

    $mdThemingProvider.definePalette('vert', {
        '50': 'e0f5f4',
        '100': 'b3e7e4',
        '200': '80d7d3',
        '300': '4dc7c1',
        '400': '26bbb3',
        '500': '00afa6',
        '600': '00a89e',
        '700': '009f95',
        '800': '00968b',
        '900': '00867b',
        'A100': 'b3fff7',
        'A200': '80fff2',
        'A400': '4dffed',
        'A700': '33ffeb',
        'contrastDefaultColor': 'light'

    });
    $mdThemingProvider.theme('myTheme')
        .primaryPalette('vert')


    $mdThemingProvider.definePalette('orange', {
        '50': 'fff3eb',
        '100': 'ffe0ce',
        '200': 'ffccad',
        '300': 'ffb88c',
        '400': 'ffa874',
        '500': 'ff995b',
        '600': 'ff9153',
        '700': 'ff8649',
        '800': 'ff7c40',
        '900': 'ff6b2f',
        'A100': 'ffffff',
        'A200': 'ffffff',
        'A400': 'ffe4da',
        'A700': 'ffd1c1',
        'contrastDefaultColor': 'light'
    });

    $mdThemingProvider.theme('myTheme')
        .warnPalette('orange') 


    $mdThemingProvider.setDefaultTheme('myTheme');
});

      

+3


source to share


1 answer


From my understanding of the official documentation, the directive md-colors

should be placed in the directive md-button

.

Example



<div class="ajouter-membre-container">
    <md-button md-colors="{ background-color: 'rouge-A100' }" href="" class="md-fab md-mini md-warn md-fab--equipe"> 
       <md-icon md-svg-src="/img/icones/add.svg"></md-icon>
    </md-button>
</div>

      

+1


source







All Articles