Skip to content

Commit

Permalink
Merge pull request #4 from tacman/patch-1
Browse files Browse the repository at this point in the history
fix "great" typos
  • Loading branch information
COil authored Oct 4, 2023
2 parents 11cee7f + 1317844 commit f3e4939
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions assets/controllers/hello_controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Controller} from '@hotwired/stimulus';

export default class extends Controller {
static targets = ["name", "greating", "dialog", "form"]
static targets = ["name", "greeting", "dialog", "form"]

connect() {
console.log("Hello, Stimulus!", this.element)
Expand All @@ -13,12 +13,12 @@ export default class extends Controller {
return
}

this.greatingTarget.innerHTML = `Hello, ${this.nameTarget.value}!`
this.greetingTarget.innerHTML = `Hello, ${this.nameTarget.value}!`
this.dialogTarget.showModal()
}

reset() {
this.nameTarget.value = ''
this.greatingTarget.innerHTML = ''
this.greetingTarget.innerHTML = ''
}
}
6 changes: 3 additions & 3 deletions assets/js/stimulus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ window.Stimulus = Application.start()
Stimulus.debug = false

Stimulus.register("hello", class extends Controller {
static targets = ["name", "greating", "dialog", "form"]
static targets = ["name", "greeting", "dialog", "form"]

connect() {
console.log("Hello, Stimulus!", this.element)
Expand All @@ -16,13 +16,13 @@ Stimulus.register("hello", class extends Controller {
return
}

this.greatingTarget.innerHTML = `Hello, ${this.nameTarget.value}!`
this.greetingTarget.innerHTML = `Hello, ${this.nameTarget.value}!`
this.dialogTarget.showModal()
}

reset() {
this.nameTarget.value = ''
this.greatingTarget.innerHTML = ''
this.greetingTarget.innerHTML = ''
}
})

Expand Down
6 changes: 3 additions & 3 deletions templates/stimulus.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
<div col="3/4">
<div {{ stimulus_controller('hello') }}>
<form {{ stimulus_target('hello', 'form') }}>
<label for="name">Enter your name below and click on the <tag>Great</tag> button
<label for="name">Enter your name below and click on the <tag>Greet</tag> button
<input type="text" name="name" {{ stimulus_target('hello', 'name') }} />
</label>

<input primary type="submit" value="Great" {{ stimulus_action('hello', 'greet:prevent', 'click') }} />
<input primary type="submit" value="Greet" {{ stimulus_action('hello', 'greet:prevent', 'click') }} />
</form>

<dialog {{ stimulus_target('hello', 'dialog') }}>
<card>
<h2 {{ stimulus_target('hello', 'greating') }}></h2>
<h2 {{ stimulus_target('hello', 'greeting') }}></h2>
<form method="dialog">
<menu>
<button {{ stimulus_action('hello', 'reset', 'click') }}>Close</button>
Expand Down

0 comments on commit f3e4939

Please sign in to comment.