This project was generated with Angular CLI version 7.0.4.
Generate a component named simple-component-example
and display it on application.
Then edit his template HTML to display :
- This message 'this is a simple component' inside a
p
tag.
Generate a component named interpolation-example
and display it on application.
Then edit his template HTML to display :
- The result of
250 * 2
using template expression and interpolation. - The string
'StringInCamelCase'
in lower case using template expression and interpolation.
Generate a component named component-attributs-example
and display it on application.
- Add the following property
name
of typestring
. - Set value of
name
property to'John Doe'
. - Edit his template HTML to display the value
name
property (using template expression and interpolation). - Edit his template HTML to display the value
name
property in upper case (using template expression and interpolation).
- Add the following property
address
of typeany
. - Set value of
address
property to :{ city: 'Tours', street: 'boulevard preuilly', number: '49', zipCode: '37000' }
- Edit his template HTML and each properties of
address
property must be displayed inside his ownp
tag (using template expression and interpolation). - Edit his template HTML and display only
city
andstreet
in upper case (using template expression and interpolation).
- Add the following property
skills
of typeany[]
. - Set value of
skills
property to :[ { name: 'Angular', version: '7.0.0' }, { name: 'TypeScript', version: '3' }, { name: 'Node.js', version: '10' } ]
- Edit his template HTML and only displays the name and version of the first skill (using template expression and interpolation).
Generate a component named property-bindings-example
and display it on application.
- Add the following property
url
of typestring
. - Set value of
url
property to'https://www.google.fr'
. - Edit his template HTML and add
a
tag (with title "go to google") - Edit his template HTML and bind the
url
property to thehref
attribut ofa
tag (using property binding with square brackets, no interolation).
- Add the following property
popCornImg
of typeany
. - Set value of
popCornImg
property to :{ url: 'https://cdn.pixabay.com/photo/2013/07/13/01/21/popcorn-155602_960_720.png', width: '100', height: '150' }
- Edit his template HTML and add
img
tag - Edit his template HTML and bind
popCornImg
propertyurl
tosrc
,width
towidth
attribut andheight
toheight
attribut ofimg
.
Generate a component named event-bindings-example
and display it on application.
- Add new method named
onTriggerSimpleMethod
- When this method is triggered you must log in the console the following message :
"Method onTriggerSimpleMethod was triggered by click event"
- Edit his template HTML and add
button
tag (with title "Trigger simple method") - Bind the method
onTriggerSimpleMethod
to theclick
event of the button. - Check if the message is correctly displayed in the web console.
- Add new method named
onTriggerMethodWithHardcodedArg
which has one argument of typestring
- When this method is triggered you must log in the console the following message :
"Method onTriggerMethodWithHardcodedArg was triggered by click event, with argument : (display argument value)"
- Edit his template HTML and add
button
tag (with title "Trigger method with hardcoded arguments") - Bind the method
onTriggerMethodWithHardcodedArg
with hardcoded string"bad hardcoded string"
as argument, to theclick
event of the button. - Check if the message is correctly displayed in the web console.
- Add a new property named
title
of typestring
- Set value of
title
property"This title will be passed as parameters of onTriggerMethodWithArg"
- Add a new method named
onTriggerMethodWithArg
which has one argument of typestring
- When this method is triggered you must log in the console the following message :
"Method onTriggerMethodWithArg was triggered by click event, with argument : (display argument value)"
- Edit his template HTML and add
button
tag (with title "Trigger method with arguments") - Bind the method
onTriggerMethodWithArg
with propertytitle
as argument, to theclick
event of the button. - Check if the message is correctly displayed in the web console.
Generate a component named builtin-directive-example
and display it on application.