Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Webpack Setup on README #247

Open
wbotelhos opened this issue Nov 24, 2022 · 2 comments
Open

Add Webpack Setup on README #247

wbotelhos opened this issue Nov 24, 2022 · 2 comments

Comments

@wbotelhos
Copy link
Owner

wbotelhos commented Nov 24, 2022

It would just be a thing like:

import Raty from 'raty-js';

new Raty(element, options).init()
@anoopnaik
Copy link

anoopnaik commented Dec 22, 2022

Hi @wbotelhos

Is the below code valid for initialising raty on a webpage ? Since the README makes no mention of calling init().

Below code works:

<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="raty.css">
	<script src="raty.js"></script>
</head>
<body>
<div data-raty></div>
	<script>
		new Raty(document.querySelector('[data-raty]'), { starType: 'i' }).init();
	</script>
</body>

Below code DOES NOT work (from README):

<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="raty.css">
	<script src="raty.js"></script>
</head>
<body>
<div data-raty></div>
	<script>
		new Raty(document.querySelector('[data-raty]'), { starType: 'i' });
	</script>
</body>

@wbotelhos
Copy link
Owner Author

Hi, @anoopnaik . The init should be called. We need to create a new section about how import and call it inside an ES6 module and fix the current instruction adding .init() on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants