Material: How to give badge's content a not static value

Created on 12 Apr 2016  路  4Comments  路  Source: angular/material

Hello all,
in Fuse-demo there are 2 examples (mail & todo) of using a notification icon in a navigation-item:
msNavigationServiceProvider.saveItem('app.module', { title : 'Module', icon : 'icon-checkbox-marked', state : 'app.module', **badge : { content: 2, color : '#F44336' }**, translate: 'MODULE.MODULE_NAV', weight : 1 });
I want to set the content the value of ModuleData.length which is in the state 'app.module' configutration:
resolve: { **ModuleData**: function ($stateParams, msApi) { return msApi.resolve('module@getAll'); } }

But does not work and I receive:

Failed to instantiate module app.module due to: ModuleData is not defined

Is it possible to make *_content *_as I want?

Thx

invalid

All 4 comments

@SAM-BI Sorry, it seems like your issue is not related to ngMaterial. Can you take a look again?

that's right, thx DevVersion :)

@SAM-BI did you ever figure this out? I'm having the same issue. Thanks!

You can only access Provider in config phase. Use "msNavigationService" instead of "msNavigationServiceProvider" in the controller rather than in the config.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WebTechnolog picture WebTechnolog  路  3Comments

pablorsk picture pablorsk  路  3Comments

PeerInfinity picture PeerInfinity  路  3Comments

sbondor picture sbondor  路  3Comments

ghost picture ghost  路  3Comments