|
1 | | -// Import and register all your controllers from the importmap under controllers/* |
2 | 1 |
|
3 | | -import { application } from "better_together/controllers/application" |
| 2 | +import { Application } from "@hotwired/stimulus" |
| 3 | +import FlashController from "./flash_controller" |
| 4 | +// import ModalController from "./modal_controller" |
| 5 | +import DynamicSelectController from "./dynamic_select_controller" |
| 6 | +import NewPersonCommunityMembershipController from "./new_person_community_membership_controller" |
| 7 | +import PersonCommunityMembershipController from "./person_community_membership_controller" |
4 | 8 |
|
5 | | -// Eager load all controllers defined in the import map under controllers/**/*_controller |
6 | | -// import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" |
7 | | -// eagerLoadControllersFrom("controllers", application) |
| 9 | +const application = Application.start() |
| 10 | + |
| 11 | +// Configure Stimulus development experience |
| 12 | +application.debug = true |
| 13 | +window.Stimulus = application |
| 14 | + |
| 15 | +console.log('start application') |
| 16 | + |
| 17 | +Stimulus.register('flash', FlashController) |
| 18 | +// Stimulus.register('modal', ModalController) |
| 19 | +Stimulus.register('bt-dynamic-select', DynamicSelectController) |
| 20 | +Stimulus.register('bt-new-person-community-membership', NewPersonCommunityMembershipController) |
| 21 | +Stimulus.register('bt-person-community-membership', PersonCommunityMembershipController) |
8 | 22 |
|
9 | 23 | // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) |
10 | 24 | import { lazyLoadControllersFrom } from 'stimulus-loading' // Adjust the path if necessary |
|
0 commit comments