fix bug in https://ractive.js.org/tutorials/hello-world/ step 1, code line 33 #154
Open
sfthurber wants to merge 1 commit intoractivejs:devfrom
sfthurber:patch-1
Open
fix bug in https://ractive.js.org/tutorials/hello-world/ step 1, code line 33 #154sfthurber wants to merge 1 commit intoractivejs:devfrom sfthurber:patch-1
sfthurber wants to merge 1 commit intoractivejs:devfrom
sfthurber:patch-1
Conversation
bug:
var ractive = Ractive({
fix:
var ractive = new Ractive({
Collaborator
|
Hi! Thanks for the PR (your very first one to be precise 🎉 ). Unfortunately, it's not a bug. See https://github.com/ractivejs/ractive/blob/dev/src/Ractive.js#L35 |
Author
|
well, it didn't work in the tutorial when i pasted the code in.it
worked after l i clicked "fix code" which changed the instantiation to
an explicit "new". so i viewed that as a bug in the tutorial.
…On 6/1/18, Joseph ***@***.***> wrote:
Hi! Thanks for the PR (your very first one to be precise 🎉 ).
Unfortunately, it's not a bug. Ractive instances can be instantiated with or
without `new`. Under the hood, Ractive has a "constructor guard" which
creates a new instance with `new` if the constructor was like a regular
function.
See https://github.com/ractivejs/ractive/blob/dev/src/Ractive.js#L34
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#154 (comment)
|
Author
|
i'll re-try it and send so screen captures
…On 6/1/18, Steve ***@***.***> wrote:
well, it didn't work in the tutorial when i pasted the code in.it
worked after l i clicked "fix code" which changed the instantiation to
an explicit "new". so i viewed that as a bug in the tutorial.
On 6/1/18, Joseph ***@***.***> wrote:
> Hi! Thanks for the PR (your very first one to be precise 🎉 ).
> Unfortunately, it's not a bug. Ractive instances can be instantiated with
> or
> without `new`. Under the hood, Ractive has a "constructor guard" which
> creates a new instance with `new` if the constructor was like a regular
> function.
>
> See https://github.com/ractivejs/ractive/blob/dev/src/Ractive.js#L34
>
> --
> You are receiving this because you authored the thread.
> Reply to this email directly or view it on GitHub:
> #154 (comment)
|
Collaborator
|
Ahh... It might be because the copy-paste code looks like var ractive = Ractive({
target: output,
template: template,
data: { greeting: 'Hello', name: 'world' }
});but the Fix Code code looks like: Notice the |
Author
|


this may help--screen captures attached
…On 6/1/18, Joseph ***@***.***> wrote:
Ahh... It might be because the copy-paste code looks like
```js
var ractive = Ractive({
target: output,
template: template,
data: { greeting: 'Hello', name: 'world' }
});
```
but the Fix Code code looks like:
```
var ractive = new Ractive({
target: '#target',
template: '#template',
data: { greeting: 'Hello', name: 'world' }
});
```
Notice the `target` and `template`. If this is the case, this would be the
bug.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#154 (comment)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bug:
var ractive = Ractive({
fix:
var ractive = new Ractive({