CSCI 446 Unit #8
Preparation:
You may want the amelia css file, which is no
longer available on bootswatch. (to download, use right-click and save link)
Read Chapter 4 of Getting Mean. As before, please
code the example as you read. Be sure to understand
the concepts/questions listed below. There are a few text
revisions. Find others? Please post on piazza.
- Table 4.1 lists routes for the example app.
Understanding how routes work is important for most (maybe all)
web frameworks. Pay careful attention to avoid frustration - small errors in
routes (e.g., location vs locations) will prevent pages from displaying.
- Figure 4.3. shows controllers for the example
app. What is the purpose of a controller?
- Good software engineering: create and test controllers
first, with no real content
- Text revision. Jade is now called Pug, but the syntax is
essentially the same. Note that there are a variety of templates,
but they all serve essentially the same purpose (reduce typing
required for html).
- Text revision.
amelia
bootstrap is no longer
online, but you can copy from the author's git repo or use the
link above.
- This is a good chance to review what you've learned about
bootstrap.
- How do we create a standard header/footer for the app?
- How do we link views to controllers?
- Good software engineering: test your views first with
hard-coded data. Customer can approve before you do lots of coding.
- When might you use the express stylesheet?
- How do we communicate data from a controller to a view?
- What is interpolation? Note that various languages
support interpolation.
- Pug syntax: what is the difference between
=
and
#{ }
?
- What is
and when might you need it in a template?
- Looping through data items is a common task. How can
we do this using the Pug syntax?
- When do we need to use the
-
with JavaScript code
within a Pug file?
- What is a mixin? How do we create and use them?
- Critical software engineering: write small chunks of code
and test. Do NOT write all your code then ask for help when it doesn't
work!!!