What Is Typescript?
Its a superset of javascript that compiles down to plain javascript. At the end of the day its still javascript and allows us to use all of the es6 features of javascript.
What Is Angular?
A framework and platform used to create SPA's. It operates under the MVVM (Model-View-ViewModel) Architecture. It also uses typescript and has a lot of built in out of the box functionality.
Some examples of built in modules in angular?
HttpClientModule
Router Module
Forms Module
BrowserModule
*Custom Modules can be made as well*
What is a promise?
A promise is an object that lets us handle the return, success, and failure of an asynchronous request. It takes a callback method that has a resolve and reject arguments and we can then decide what happens after that promise has returned by using the .then() and .catch() to handle the success and the failure respectively
What is the difference between the ‘id’ attribute and the ‘class’ attribute of HTML elements?
Multiple elements in HTML can have the same class value, whereas a value of id attribute of one element cannot be associated with another HTML element.
Pro's and Con's of Typescript?
Type Safety. Better organization. Rich IDE Support. Readability. Easier Bug Catching. Cross-browser and cross platform compatibility
Difference between Angular and React?
Angular operates on principles of OOP while react is Functional.
Angular has form validation and handling. React doesnt.
Angular has a built in HTTPCLIENT module to make http requests. React does not offer one natively.
Angular has 2 way data-binding. React is Unidirectional.
What are the ways we can communicate between components?
@Input Decorator: Parent to Child Relation
@Output Decorator: Child to Parent relation*Also needs an event emitter attached*
Service: Sibling components, and unrelated components *Uses dependency injection to pass the data into the components with the @Injectable decorator
*Bonus: ViewChild: Research This!
how would i get a value from an input field using vanilla javascript
selector.value
What are the different values for CSS positioning?
What is "TSC" and how does it work?
TypeScript Compiler, and it transpiles typescript code down to ES5
What are some angular CLI commands?
ng new my-app(making a new project)
ng generate component (make new component)
ng generate service (make new service)
ng build (to build our application)
ng serve (to serve our application to our localhost)
*plus a lot more*
What are services and dependency injection?
Services are singleton classes that are used to share data across components that need it. Dependency Injection is taking the data from a service and INJECTING it into the components that need it.
what are the ways we can create an object?
Object Literals
Constructor Functions
Object.Create
What is the difference between “display: none” and “visibility: hidden”, when used as attributes to the HTML element.
When we use the attribute “visibility: hidden” for an HTML element then that element will be hidden from the webpage but still takes up space. Whereas, if we use the “display: none” attribute for an HTML element then the element will be hidden, and also it won’t take up any space on the webpage.
What is an Interface?
A group of key/value pairs used to define a collection of your data and group them together
If we make a new component, where do we have to import that component in order to use it in our application?
In our module.ts file. Specifically into the declarations array in our NgModule.
What are the different types of directives and examples of built in directives for each type?
*Bonus: can we make our own directive?
Components: A directive with its own template attached to it.
Structural Directives: These are used to add or remove HTML from the dom. *Built in: ngFor, ngif
Attribute Directives: Changes the feel of our dom by adding or removing styles, classes, and properties from out HTML. *Built in: ngStyle, ngClass
*There are a few more built in directives.
*Custom attributes do exist to allow us to create directives with custom settings to be used.
What are the main primitive datatypes in javascript?
String
Number
Boolean
Null
Undefined
In how many ways can we specify the CSS styles for the HTML element?
There are three ways in which we can specify the styles for HTML elements:
What Are Decorators?
Functions that can be attached to classes in order to change the behavior of a class. We use the "@" to denote when we are using a decorator
What are the parts that make up a component?
Selector: the custom css-selector that will be used to place our components template into the html
templateUrl: the file for our html template. *Can also include template in this area without the need of making a separate html file*
styleUrls: An array of stylesheets can be added in this area.
What forms of data-binding does angular accept?
String Interpolation
Property Binding
Event Binding
*IMPORTANT* 2-way Data Binding
Explain Call, Apply, and Bind methods
Call: This method invokes a method by specifying the owner object. Call allows an object to use the methods of another object
Apply: Very similar to the call method except apply method takes arguments as an array where call takes arguments separately
Bind: this method returns a new function where the value of "this" will be bound to the owner object.
What are Semantic Elements? Why are they important?
Semantic elements are those which describe the particular meaning to the browser and the developer. Elements like <form>, <table>, <article>, <figure>, etc., are semantic elements.
They allow us to organize our html and structure it for better readability, structure, and allows anyone coming after us to easily understand our code base.