LinkedIn Angular JS
Exam Type: | LinkedIn Skill Test |
Last Update | November, 2024 |
Pass This Exam
Our Expert will clear your test via TeamViewer or Skype 24/7.
Exam Detail
AngularJS linkedin assessment
What is the primary difference between a component and a directive?
A component uses a selector metadata property and a directive does not.
A directive can be used for adding custom events to the DOM and a component cannot.
A directive can only target native DOM elements.
A component has a template, a directive does not.
linkedin learning AngularJS
Which DOM elements will this component metadata selector match on?
@Component({
selector: 'app-user-card',
. . .
})
a) any element with the attribute app-user-card, such as
any element with the attribute null, such as null
b) the first instance of
c) all instances of
d) all instances of
linkedin Angular assessment answers
Pick the best description for the following template syntax code:
Boss: {{ job?.bossName }}
There is an error in this template syntax. The ? is not valid here.
It is using the safe navigation operator (?) on the job field. If the job field is undefined, the access to the bossName will be ignored and no error will occur.
The ? is shorthand for the async pipe. The job value must be an Observable.
It is displaying the job value if it has one; otherwise it is displaying the bossName.
linkedin AngularJS assessment answers
What would be an example template syntax usage of the following custom pipe?
@Pipe({ name: 'truncate' })
export class TruncatePipe implements PipeTransform {
transform(value: string, maxLength: number, showEllipsis: boolean) {
const newValue = maxLength ? value.substr(0, maxLength) : value;
return showEllipsis ? `${newValue}...` : newValue;
}
}
{{ 'some long text' | truncate }}
{{ 'some long text' | truncate:10:true }}
All of these are correct.
{{ 'some long text' | truncate:10 }}
Pass This Exam
Our Expert will clear your test via TeamViewer or Skype 24/7.