I would like to use Semantic UI in my Angular2 application. The problem is that I can't find a router setting that changes the default name of "router-link-active" class. I need it to be called just "active" to make menus display properly.
As I understand, such setting doesn't exist. I've seen it in Vue.JS so I expect it to be there too. Is it a good idea to ask developers to fix this?
So. We need to write a custom directive that adds "active" class to all DOM elements with "router-link-active" class, but I've got some problems here too.
There is a similar question but the answer is too complicated and didn't work for me. So I have read some documentation and decided to do something better like this:
commons.ts:
@Directive({
selector: '.router-link-active',
host: {'[class.active]': 'trueConst'} //just 'true' could also work I think...
})
export class ActiveRouterLinkClass {
trueConst: boolean = true; //...if 'true' works we don't need this
}
Then I've imported ActiveRouterLinkClass into my main.component.ts and added it to the component's directives list. Unfortunately, now I have this error: "EXCEPTION: Unexpected directive value 'undefined' on the View of component 'Main'". Please, explain what I did wrong!