Skip to main content

Posts

Default Parameters

Recent posts

Es6 Topics

Es6 Topics Let, Const Arrow Function Default Parameter Values Rest Parameter Spread Operator Template Literals Classes Class Definition Class Inheritance Class Inheritance, From Expressions Base Class Access Static Members Getter/Setter

JavaScript Codes

Javascript Codes Use this for Add Class on menu links using Javascript (function(){ var el = document.querySelectorAll('.custom-menu-primary a') el.forEach(function(e){ e.classList = e.textContent.toLowerCase().replace(/[^a-zA-Z0-9\.-]+/g,""); }) })(); Add Class on Scroll using Varible Height (function() { let _body = document.getElementsByTagName('body'); window.addEventListener('scroll', function() { _top = window.scrollY; if (_top > 100) { _body[0].classList.add("fadIn"); } else { _body[0].classList.remove("fadIn") } }); })(); Add Class on Scroll using Varible Height (function() { let _body = document.getElementsByTagName('body'); let herderHeight = document.querySelector('.header-container-wrapper&#

What is Directives in angular

Angular templates are dynamic. when angular renders them, it transforms the DOM according to the instructions given by directives. A Directive is a class with a @Directive() decorator. in addition to components, there are two type of directives Structural and attribute. angular defines a number of directives of both kinds, and you can define your own using 

What is Component in angular

Components define views, which are sets of screen elements that angular can choose among and modify according to your program logic and data. Component are simply classes, with decorator that mark their type and provide metadata that tells angular how to use them. The metadata for a component class associates it with a template that defines a view. A template combines ordinary HTML with angular directives and bind markup that allow angular to modify the HTML before rendering it for display. So in simple terms a component in Angular is composed of these 3 things Template - Defines the user interface. Contains the HTML, directives and bindings. Class - Contains the code required for template. Just like a class in any object oriented programming language like C# or Java, a class in angular can contain methods and properties. Properties contain the data that we want to display in the view template and methods contain the logic for the view. We use TypeScript to create the class

Steps for install angular on your machine

Install Node Js from  https://nodejs.org/en/ .  after install node check installation is successful run command on CMD   node -v show the node version. Open Command Prompt Run as administrator and run command " npm install -g @angular/cli " when install angular cli shows some error and warning  ignore them.  After install the angular cli create the project in the C Drive when open command prompt run as administrator show the current path like this "C:\Windows\system32>" go to the root run "cd/" command  then enter go to the root "C:". Run command " ng new project-name "  like this "ng new angularApp " press enter.  go to our project folder "cd angularApp" press enter. run command " ng serve -o" this command run local server and shows your app on your browser http://localhost:4200. Extra command " https://github.com/angular/angular-cli/wiki"