Skip to content

How to instantiate Raty in Angular 19 #255

@bnlambert

Description

@bnlambert

I am trying to use raty-js with flyon UI .

My code looks like this

import * as Raty from 'raty-js';

...

new Raty.Raty(document.querySelector('#raty-read-only') as HTMLElement, {
        starType: 'i',
        starOn: 'icon-[tabler--star-filled] size-4',
        starOff: 'icon-[tabler--star-filled] opacity-20 size-4',
        half: true,
        score: () => 3,
        readOnly: () => true
      })

I get the error RROR TypeError: (void 0) is not a constructor

What is the proper way to use raty-js in Angular 19?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions