Trapped-Demo.st 651 B

123456789101112131415161718192021222324252627282930313233
  1. Smalltalk current createPackage: 'Trapped-Demo' properties: #{}!
  2. TrappedPlainModel subclass: #App
  3. instanceVariableNames: ''
  4. package: 'Trapped-Demo'!
  5. !App methodsFor: 'initialization'!
  6. initialize
  7. super initialize.
  8. self payload: #{'items'->#('hello' 'world'). 'title' -> 'To-Do List'}
  9. ! !
  10. Widget subclass: #AppView
  11. instanceVariableNames: ''
  12. package: 'Trapped-Demo'!
  13. !AppView methodsFor: 'rendering'!
  14. renderOn: html
  15. html h2 trapShow: #('title').
  16. html p trapShow: #('items')
  17. ! !
  18. Widget subclass: #NameView
  19. instanceVariableNames: ''
  20. package: 'Trapped-Demo'!
  21. !NameView methodsFor: 'rendering'!
  22. renderOn: html
  23. html root trapShow: #()
  24. ! !