Challenge your understanding of key Angular concepts, syntax, and project structure with these carefully chosen questions. Perfect for beginners eager to strengthen their Angular basics.
Angular is maintained and primarily developed by which tech giant?
Explanation: Google is the primary maintainer and developer of Angular. Microsoft develops a competing framework, while Facebook maintains React. Choosing the wrong company may reflect confusion between similar frontend libraries.
Which language is primarily used to write Angular applications?
Explanation: TypeScript is the main language for Angular, offering strong typing and advanced features. JavaScript is a prerequisite but not the default for Angular apps. Dart is unrelated to Angular and more tied to Flutter.
What decorator is used to define a component in Angular?
Explanation: @Component decorates classes as Angular components. @Directive is for directives, not components. @Inject is used for dependency injection purposes and not for defining components.
Which Angular directive is used to loop through and display a list of items in a template?
Explanation: ngFor repeats an element for each item in a list. ngIf handles conditional rendering, not iteration. ngSwitch is for multiple conditional branches, not for handling arrays.
What Angular feature is responsible for handling navigation between different views or pages within an application?
Explanation: The Router enables client-side navigation between views. Service is for sharing logic/data; Pipe transforms data in templates. Neither Service nor Pipe handles view navigation.
Which Angular concept is commonly used to share data or functionalities between multiple components?
Explanation: Services provide shared logic and data to many components. Modules organize components/services together. Pipes process data for display, not sharing it between components.
Which Angular CLI command is used to create a brand new Angular project from the terminal?
Explanation: ng new initializes a fresh project. ng serve starts a development server, and ng build creates a deployable bundle, but neither creates new projects like ng new does.
What is the term for the mechanism in Angular that detects changes and updates the UI accordingly?
Explanation: ChangeDetection refers to Angular's system for tracking and reacting to data changes. DataBinding describes how data moves between parts of the UI, while Animation is unrelated to updating changed data.
Which file in an Angular project lists all the project's dependencies and scripts?
Explanation: package.json holds project dependencies and scripts. angular.json contains Angular CLI-specific settings, and tsconfig.json configures TypeScript options, not package dependencies.
What structure in Angular is used to organize components, directives, and services together?
Explanation: A Module groups related parts for structure and maintainability. Component is a fundamental UI building block, while Library refers to external or shared code, not the primary way Angular organizes its features.