Updates from May, 2019 Toggle Comment Threads | Keyboard Shortcuts

  • shashankgee 5:40 am on 24 May 2019 Permalink | Reply  

    Difference between event.stopPropagation and event.stopImmediatePropagation() 

    event.stopPropagation will prevent handlers on parent elements from running.
    Calling event.stopImmediatePropagation will also prevent other handlers on the same element from running.

    pls refer the below link.

    Say, if you have a <table>, with <tr>, and then <td>. Now, let’s say you set 3 event handlers for the <td> element, then if you do event.stopPropagation() in the first event handler you set for <td>then all event handlers for <td> will still run, but the event just won’t propagate to <tr> or <table> (and won’t go up and up to <body><html>document, and window).

    Now, however, if you use event.stopImmediatePropagation() in your first event handler, then, the other two event handlers for <td> WILL NOT run, and won’t propagate up to <tr><table>(and won’t go up and up to <body><html>document, and window).

    Advertisements
     
  • shashankgee 2:03 am on 24 May 2019 Permalink | Reply  

    How to uninstall Angular CLI? 

    This post is to describe how to uninstall angular cli and install latest version of angular/cli

    $ npm uninstall -g @angular/cli
    $ npm cache clean
    $ npm install -g @angular/cli
    

    Notes :

    • On Windows run this using administrator
    • On Mac use sudo ($ sudo <command>)
    • If you are using npm>5 you may need to use cache verify instead. ($ npm cache verify)
     
  • shashankgee 7:11 am on 23 Apr 2019 Permalink | Reply  

    CSRF, XSS (type of web attacks) 

    please refer the site to know about CSRF and XSS

    https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.md

     
  • shashankgee 3:58 am on 30 Jan 2019 Permalink | Reply  

    Event Bubbling or Event Capturing? 

    Event propagation:

    There are two ways of event propagation in the HTML DOM, bubbling and capturing.

    Event propagation is a way of defining the element order when an event occurs. If you have a <p> element inside a <div> element, and the user clicks on the <p> element, which element’s “click” event should be handled first?

    In bubbling the inner most element’s event is handled first and then the outer: the <p> element’s click event is handled first, then the <div> element’s click event.

    In capturing the outer most element’s event is handled first and then the inner: the <div> element’s click event will be handled first, then the <p> element’s click event.

    With the addEventListener() method you can specify the propagation type by using the “useCapture” parameter:addEventListener(eventfunctionuseCapture);

    for Reference:

    https://www.w3schools.com/js/js_htmldom_eventlistener.asp

     
  • shashankgee 5:51 am on 23 May 2018 Permalink | Reply  

    Tools in Front End 

    Karma
    ==========
    Google’s Java script Test Runner and natural Choice for testing Angular js. In addition to
    allowing you to run your tests on real browers (including phone and Tablet browers) it is
    also a test framework agnostic. which means that you can use it in conjunction with any
    test framework like Jasmine,Qunit,Mocha among others

    Jasmine
    ==========
    Test framework in which we write our tests.

    Yeoman
    ==========
    Yeoman is a tool set containing a 3 components (Grunt,bower,and scaffolding tool YO).
    YO generates boilerplate code with the help of generators(which are just scaffolding templates)
    and automatically configure Grunt,bower for your project. you can find generators for almost
    any JavaScript framework (Angular , ember, backbone).

     

    Grunt
    ==========
    Grunt is a task runner which automates several repetitive tasks such as minification,compilation
    build,testing,and setting up a preview of your angularjs application.

    Gulp
    ==========
    Gulp is also a test runner. like grunt.

    WebPack
    ==========

    Bower
    ==========
    is a package manager that helps you find and install your application dependencies. such as
    css frameworks and javascript libraries, and so on. it runs over git and avoid manually downolad
    and the updates dependencies.

    Protractor
    ==========

    End-to-End Testing e2e testing framework.

     

     
  • shashankgee 7:24 am on 27 Mar 2018 Permalink | Reply  

    Security in Angular js 

    If you talk to the server via https, you don’t have a problem with replay attacks.

    My suggestion would be to leverage your server’s security technology. For example, JavaEE has an out-of-the-box login mechanism, declarative role-based protection of resources (your REST endpoints) etc. These are all managed with a set of cookies and you don’t have to care about storage and expiration. Check out what your server/framework already gives you.

    If you plan to expose your API to a broader audience (not specifically to the browser-based UI that you serve) or other types of clients (e.g. mobile app), consider adopting OAuth.

    Off the top of my head, Angular has the following security features (will add more as they pop-out):

    CSRF/XSRF attacks

    Angular supports an out of the box mechanism for CSRF protection. Check out $http docs. Server-side support is needed.

    Content Security Policy

    Angular has a mode of expression evaluation that is compatible with more strict JavaScript runtimes that are enforced when CSP is enabled. Check out ng-csp docs.

    Strict Contextual Escaping

    Use Angular’s new $sce feature (1.2+) to harden you UI against XSS attacks etc. It’s a bit less convenient but more secure. Check out the docs here.

     
  • shashankgee 7:05 am on 21 Mar 2018 Permalink | Reply  

    animate.css 

    Here you can have Animation classes you can use once import the animate.css file into your application

     

    https://daneden.github.io/animate.css/

     
  • shashankgee 9:42 am on 8 Mar 2018 Permalink | Reply  

    angular crud application 

    1. https://marinantonio.github.io/angular-mat-table-crud/
    2. https://github.com/marinantonio/marinantonio
     
  • shashankgee 8:17 am on 5 Mar 2018 Permalink | Reply  

    How To Handle XSS or CSRF Attacks in Angular 4 ? 

    https://www.code-sample.com/2017/09/angular-4-handle-xss-csrf-attacks.html

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel