Assignment03
Assignment03
Assignment #3 (10%)
This assignment will test your knowledge of Angular and the building block we
have covered so far.
o Area #1
Make sure a CSS class is used to make the background colour a gradient fill (at least 2 colours-radial
or linear); This will be the initial background setting that will correspond to the initial data in the
input box.
Create a variable to hold a Day of the Week (will be referred to as DOW variable)
Include the Day of the Week when you have this class using the data passed in from the app
component that includes your personal data
Since you are importing your personal data, it must be loaded before you can use it so you
will have to initialize your DOW variable in the ngOnInit() function
Ex. I created a variable called dow; the sharing variable I used was called cinfo
ngOnInit(): void { this.dow = this.cinfo.dow; }
Include a header line (use a lower level header tag such as h4 or h5) to direct user to enter a day of
the week in the following input box (ex. "What day do you have SYST24444 class?")
2
A3 ANGULAR – NJIT
Add an ngClass to Area #1 to change the background colour based on input box data compared to
your personal data (day of week comparison should not be hard-coded)
If days of week are equal, use a CSS class to include a radial-gradient background (must
include at least 2 colours) for this area only
o NOTE: This can be the initial background CSS used when setting up the grid layout
If days of week are not equal, use a different CSS class to include a different coloured radial-
gradient background for this area only (must include at least 2 colours)
Include a horizontal line then a paragraph that includes an ngIf and ng-template (paragraph
included inside here also) to determine what text to include
If your DOW variable is equal to your personal DOW information shared from the app
component, the text will be “My class is on <DOW variable>” else the paragraph text will be
“Your class is on <DOW variable>
Make sure the check works not matter how the user enters the day of week (case
indifferent)
Add an ngStyle to each paragraph; For equal paragraph, change the font to bold; for not
equal paragraph in ng-template, change the font style to italic.
o Area #2
Add a heading line to let the user know to click a button to change the border of the image in the
informational area (your choice of wording)
Add 4 buttons for "Thick Solid Square", "Thick Solid Round", "Thick Double Square", and "Thick
Double Round". You can use text as shown below or use images that depict the border.
Add a click event to each button. You can create 4 separate functions or one function and pass in
arguments.
MUST use attribute formatting (ngStyle) to make each button text a different colour
(example shown below) which will be the colour of the border displayed also.
When each button is clicked, change the border options of the image in the Informational
area using JavaScript.
o NOTE: You may want to give your <img> tag a unique ID
o If you get the error (Object is possibly 'null'), include the ! after you search for your
element using document.getElementById("mypic")!
o (post-fix expression operator !)
3
A3 ANGULAR – NJIT
Grading View:
I will be using the Chrome Toggle Device Bar for Galaxy S5 in Landscape mode when grading your site
REMEMBER, this must be in a mobile layout; too much scrolling or whitespace will reduce your mark
Grading rubric:
Class creation with your personal data included in the app component and sharing and usage
1.5
of this data into all child components
Header and Footer components 2
Area #1 within the Content component 2.5
Area #2 within the Content component 2.5
Informational area within the Content component 1.5
4
A3 ANGULAR – NJIT