question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Looks like [class] property doesn't work

See original GitHub issue

i tried to use it like <svg-icon name='travel' [svgStyle]="{ 'width.px':22, 'height.px':22 }" [class]="'test-class'"></svg-icon>

and i can’t see test-class on the svg-icon compoent. image

but with normal class like class=“test-class” it works

maybe it’s because https://github.com/czeckd/angular-svg-icon/blob/4f6319ec165a293f387aa2a3c5d4632d7017dd01/projects/angular-svg-icon/src/lib/svg-icon.component.ts#L83

or i did something wrong?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
czeckdcommented, Feb 10, 2021

@Andikki - Thanks! That was the clue I needed. A new version should be available shortly that hopefully will resolve this interpolated class issue on svg-icon.

0reactions
Andikkicommented, Feb 9, 2021

I see. The code where class broke uses interpolation, like so:

<svg-icon src="./assets/some-icon.svg" class="icon--{{someCalculatedValue}}"></svg-icon>

In this case, with someCalculatedValue resolving to 1, I should see the class icon--1 on the <svg-icon>, but it doesn’t happen.

I now see that simple cases with no interpolation work as intended.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typescript - Class property doesn't exist - Stack Overflow
I have set up 2 basic projects with the same configuration for Babel and Typescript. One of my project is actually a module,...
Read more >
Unable to access extended properties in constructor #1617
To execute the Base constructor after Derived class values have been set I am including Base constructor's operations in a setTimeout function.
Read more >
this - JavaScript | MDN
Class methods behave like methods in object literals — the this value is the object that the method was accessed on. If the...
Read more >
How To Use Classes in TypeScript | DigitalOcean
Classes are a common abstraction used in object-oriented programming (OOP) languages to describe data structures known as objects.
Read more >
Effective Dart: Design
Since privacy in Dart works at the library level, not the class level, this is a way to define “friend” classes like you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found