From 50c4a75b49aa58200a9f0ac485274c8c635b5a76 Mon Sep 17 00:00:00 2001 From: Matt Mo Date: Sat, 12 Dec 2020 13:28:32 -0800 Subject: [PATCH] Adding active class to router link element as well and cleaned up code. --- ignite-router.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ignite-router.js b/ignite-router.js index 6fa971f..8c2c66a 100644 --- a/ignite-router.js +++ b/ignite-router.js @@ -34,10 +34,8 @@ class RouterLink extends IgniteElement { render() { return this.template .onClick((event) => this.onClick(event)) - .child( - new slot(this) - .class(this.active, (value) => { return value ? "active" : null }) - ); + .class(this.active, value => value ? "active" : null) + .child(new slot(this).class(this.active, value => value ? "active" : null)); } ready() {