HTML Css
HTML Css
HTML Css
No Questions
1 What is ngModule?
8 What is comoponent?
10 what is routing?
19 What is a promise?
20 What is observable?
21 Difference between promises and observables?
22 What is injectable?
23 Waht is ngDoCheck?
24 Is it possible to add multiple CSS inside component?
25 Exceptation handling in JS?
Library is collection of classes and methods at single point. But framework is collection of libraries.
Decorator tells to angular, how to process on the class. @component
Gives extra information about the decorator.
Used to send the forcefully from child to parent. As well as used to capture custom events.
by attaching @output decorator with the help of event emmitter.
Apllying css of parent and child depending on condition called as view encapsulation. There three
ways 1. none(plain css) 2. default(Angular's by default option) 3. Native(Native shadow dom)
It is async or parellal flow of execution which can handle single event at a time. Added in ES6.
Promises has two events out of which one will be executed at a time i.e. resolve and reject. If
condition is true then resolve will be executed unless reject will be executed. Promises does have
error handling capability and can not be cancelled. promises doesn't require to subscribe.
It is async or parellal flow of execution which can handle multiple event at a time. It came from
RxJs library and availble from old javascript. Obs can handle three events i.e. next, complete and
error. Obs has error handling capability unlike promises. Obs can be cancellables. Obs needs to be
subscribe at any cost. Obs are like promises will more facilities. Obs provides operators like
subject, behaviour subject, map, filter, pipe, from, of, reduce.
availbale in service, also responsible for injecting one service into another service.
Part of angular life cycle and used to change detection purpose.
Yes
with the help of try and catch block simply like if else block.
It is a pattern of class coding in which class recieves its dependency externally rather than creating
itself. Constructor is reposnsible for DI.
When we run ng build command we will get dist folder of minified js, html, css files. That folder
we need to put on c-panel/ hosting location.
Template Driven: Max logic written in html, require ngModel, used simple scnarios, complex for
validation as well testing. require FormsModule to be imported. Reactive : Max logic written in ts
file, doesn't require ngModel, used complex scnarios, less complex for validation as well as testing.
require ReactiveFormsModule to be imported
Used to transfer the data from one form to another form, two types built in and custom pipes.
Custom pipe can be created with ng g p pipeName. We need to call the selector of custom pipe in
comp.html.
AOT: download and Convert code into minified js before browser run the code. Faster. Suitable for
production mode, less bundle size, less loading time. From angular 12 AOT mode will be by
default. JIT: Browser download code and convert to minified js after browser run the code. Less
faster, max bundle size, used development mode.
Using promise.all method we can call multiple API's. And using .then method we can get the data.
1. Using promise.all method 2. forkJoin() method.
Attribute Dir: Responsible changing behaviour of the DOM. ngClass, ngStyle. Structural Dir:
Adding and removing elements from the DOM. *ngIf, *ngFor, *ngSwitch.
Yes with ng g d dirName.
var a=[1,2,3,];
Do it on yourself.
Using data binding.
Maps the data and convert it into new observable.
Angular is framework based on JS and TS. Used for SPA.
Do it on yourself.
Used to bind routes with root module i.e. app module.
JWT is used authentication purpose. Token will be generated during first or login API and saved at
UI(localstorage or session storage) as well as backend. Now when we call another API that token
will compare. If tokens are matching then data will be sent to UI otherwise will not get the data.
Now AOT will be by default in from angular 12. And AOT is better than JIT.
To decrese loading time we are converting our complete project in moduler structure. Only those
modules will be loaded at a time which are used on browser.
Using guards and JWT we can implement authentication in angular.
Used for strict coupling of the data.
Question from node.js
promise=> promise.all observables=> forkJoin()
It is guard used with route to give the permission to enter into component or module.
Used in angular Js same as *ngFor.
Extend: Used to import class. Implements: Used to import the interface.
Accessing methods and properties of parent class in child class is called as inheritance.
AT a time only one object will be created for the service.
Used to authentication purpose.
Will act like an inheritance
using binding
ng g s serviceName Built in service: http client
do it on ur self
1. spread operator. 2. object.assign
setTimeout: will execute after given time. setImmediate: will execute immediately like call back
funct. setInterval: will execute repeatedly for give time. To stop interval need to use
clearInterval(intervalName)
The package. json is used for more than dependencies - like defining project properties,
description, author & license information, scripts, etc. The package-lock. json is solely used to lock
dependencies to a specific version number
Compilation as well as transpilation options are available in tsconfig.json but in package.json
depencies are there. Transpilation: TS to JS. Compilation is JS to minified JS.
Input, Outpu, ViewChild
viewChild, ng-content
SPA, custom component, testing, Cross platform, separate ts, html, css. Routing
ANgularJS: Completed based JS. Angular : Based TS and JS
The async pipe subscribes to an Observable or Promise and returns the latest value it has emitted.
Pure Pipe: Wherever data chnages Impure Pipe: On change of evry life cycle method.
Used to handle wrong/ mismatch of path in the application.
Common mudule are reposible for importing directive, templeting, core functinality of angular.
IVY is an engine used to run angular code internallly.
Used for browser compatibility.
ng test
use of JWT and guards.
no
The pipe operator has a higher precedence than the ternary operator
Suppose I want to load one component before redndering all other feature module and
component. SO with the help of entrycomponent I can use that comp without calling selector of
that perticular comp
2 What is closure?
3 What are datatype in javascript?
4 What strict Mode in javascript?
5 What is variable typing?
6 What is call back function in JS?
7 What is splice? How can I replace chars inside the string?
8 Solve 10+20+’30’ and ‘10’+20+30 and 10 + '20' + 30
9 Difference between local storage, session and cookie?
10 What is light weight JS or J Query?
11 How can we hide any div using JS not by angular ?
12 WAP to print hello1 hello2 hello3 without usnig loop?
JS
do it on urself
do it on urself
callback doesn't have error handling capability. Priomie will surely give output
object undefined
false false--- do it on urself
do it on urself
do it on urself
negative number devided by zero
do it on urself
do it on urself
do it on urself
re declaration is not possible
push, splice, spread, unshift
do it on urself
do it on urself
do it on urself
do it on urself
do it on urself
to achive OOPS
if variable used before defining it is called as variable hoisting console.log(a); var a= 5;
using prototype keyword we can achive inheritance in plain JS.
var let const this
ternory operator
do it on urself
do it on urself
do it on urself
do it on urself
do it on urself
do it on urself
tsc abc.ts
do it on urself
let block scope and var functional scoep
do it on urself
do it on urself
do it on urself
do it on urself
Sr No Question
7 boostrap layout
8 classes of bootstraps
9 Diff bet span and div ?
16 Z-index in css?
17 CSS position,display attribute
18 How to achieve responsive design
19 Doctype in html
20 Bootstrap classes to make web page responsive?
Write CSS code to show backgroung image and on that text will be
21 there?
If I have 3 text fields in html then I want to focus on one text box
when comp loads?
diff bet local and session storage?
Features Html
Browser HTML is compatible with almost all browsers because it has been
compatibi present for a long time, and the browser made modifications to
lity support all the features.
Graphics In HTML, vector graphics are possible with tools LikeSilver light,
support Adobe Flash, VML, etc.
Threading In HTML, the browser interface and JavaScript running in the same
thread.
Storage Uses cookies to store data.
Vector Vector graphics are possible with the help of technologies like VML,
and Silverlight, Flash,etc.
Graphics
Shapes It is not possible to create shapes like circles, rectangles, triangles.
Vector In HTML4, vector graphics are possible with the help of techniques like
Graphics VML, Silver light and Flash.
Html5 uses cookies.
Shapes It is not possible to draw shapes like circles, rectangles, triangles.
<div>
Block element
Used for CSS based HTML Layouts
Support align attribute, div tag displayed in new line
Used to wrap a section that requires highlighting
Answer
HTML5 is a new version of HTML with new functionalities with
markup language with Internet technologies. Language in
HTML does not have support for video and audio
There are two major layouts for Bootstrap that are Fluid Layout
and Fixed Layout.Fluid-layout: This uses the bootstrap .
container-fluid class for the layout. This layout uses
proportional values such as measuring units for a block of
content, images, or any other item
refer below
visibility:hidden hides the element, but it still takes up space in
the layout. display:none removes the element from the
document. It does not take up any space.
The CSS box model is essentially a box that wraps around every
HTML element. It consists of: margins, borders, padding, and
the actual content. The image below illustrates the box model:
body {
background-image: url("paper.gif");
}
Html5
The HTML5 has the JavaScript Web Worker API, which allows the
browser interface to run in multiple threads.
Uses local storage instead of cookies
Vector graphics is an integral part of HTML5, SVG and canvas.
<span>
Inline element
Used to stylise text
No align attribute, does not begin a new line
Wrap any particular word and to highlight it
Sr No. Questions
1 What is Git and why is it used?
If more than one deverloer is going to commit the code in same file inside same
branch then git will confuse whose code should take so this will give conflict.
There are few ways to resolve conflict. 1. By Accpeting current changes: Will
accept only your code and will replace earlier code. 2. Accpeting both chnages :
Will accept both code. 3. BY accpeting Incoming Changes : accept other
developer code(latest code wchich will available at the branch) and your code
will get replace.
It gives the stautus of changed files as well as added files.
Will add files from local to git stage. Command: git add path ===> will add the
files from that path only. Git add . ===> will add all the files where the
developer has made the chnages.
git remote add origin git@github.com:username/new_repo
1. Save changes to branch A. 2. Run git stash. 3. Check out branch B. 4. Fix the
bug in branch B. 5. Commit and (optionally) push to remote. 6. Check out
branch A 7. Run git stash pop to get your stashed changes back.
For local : 1 git branch -d <branch_name> ===> will delete branch if all your
current branch code has been merged into main branch. 2 git branch -D
<branch_name> ===> will delete current branch forcefully without checking
code megrge status. For remote: git push <remote_name> --delete
<branch_name> ====> will push all the code to main branch and delete the
current branch.
git pull : will take latest code from remote branch. Git fetech: will inform only
chnages but not actully taking pull.
Can easily track pull, push, merge request as well as status of all branches.
Cognizant
1 Angular Workspace
Angular Web components/ Angular elements not angular
2 component
3 PWA
4 Decrease loading time
5 diff bet ng 2 and 4.
6 state management in angular
7 diff bet const and readonly
8 diff bet mutable and immutable object in JS
9 What is subject
10 Diff bet switch map and merge map
11 Service workers
13 features of angular 13
14 const arr = [1, 2] can we push element to array
Normally with the help of ng new demo we can create new single angular project. But if we want to create multiple projects o
share libraries between projects then it is possible with the help of angular workspace. To Achieve this: ng new my-workspace
create-application false this will create workspace without scr folder but with node_modules. Now if I want to create angular
inside that then go inside my-workspace and run ng new application my-first-app also we can create another project at same
location ng new application my-second-app
Special type of multicast operator used for intercomponent communicatin using the service.
switchMap cancels previous HTTP requests that are still in progress, while mergeMap lets all of them finish.
Yes
Concept of dependency injection. As service is singleton we need the scope of service inside the class only that's why we are u
private
Promise will call first as observables are lazy until and unless we subscribe the data observable is not going to execute.
Yes
ROPA