Categories
Javascript Uncategorized

Reading JSON data in Angular JS (Part-1)

Scenario: – How to fetch JSON data from backend into User Interface (UI) of application using Angular JS? Solution:- We have divided our solution approach into 2 parts; in part-1, tutorial we would fetch the data in a straight flow, without thinking about the framework level things. Flow:- Code:- Download from GitHub JS File //Creat […]

Categories
Javascript

Difference between {{}} and ng-bind in AngularJS

To bind our data to the HTML page, Angular gives the ability to use {{}} known as double curly brackets or ng-bind.Both ways are performing the same functionality.   {{}}   Example:-       name is JS object or some variable we are referring to. It makes your template very readable i.e Anyone going through […]

Categories
Javascript

XMLHttpRequest Cannot Load error in AngularJS

Error:- XMLhttpRequest Cannot load ? How to handle this error.   Browser Error Solution:- This is common error when you attempt to open load files directly in chrome. Reason, Chrome and other browsers have imposed security restrictions for “Cross Origin Requests“, which means that you cannot load the files directly from your local hard-disk to […]

Categories
Javascript

Conditional display of elements/data using Angular Js Directives.

Today we would learn frequently used Angular JS directives.   Problem:- How to achieve conditional construct in Angular js?   Solution:- We would achieve it by using built in directives of Angular JS. 1. ng-Switch:-We can control the conditional display of data. It is similar to Switch-Case in JavaScript. JavaScript syntax:- Switch(expression) { Case n: […]

Categories
Javascript

How to optimize the performance of ng-repeat in AngularJS?

Today we would focus on improving the performance of Angular JS code by learning the basics of ng-repeat and then how to enhance its capabilities. Follow us for more learning Fb,G+,Twitter. ng-repeat :-  It is directive which create instant of template for each item in the collection. It is identical to looping concept in any language […]

Categories
Javascript Uncategorized

AngularJS $watch() ,$digest() and $apply()

This post is meant for novice AngularJS programmers to enlighten them with basic comprehension of how data-binding works. To deep-dive into data-binding, you need a clear vision of how $watch(), $digest(), $apply() and dirty checking works.Lets go step by step on this topic.Do folow us on FB page, Twitter or G+ for more updates and learning.“It is not about doing so […]

Categories
Javascript

AngularJS Interview Questions-Set1

Here comes our first set of Interview questions on Angular JS. Hope it assist the job aspirants to crack the interviews.Do like our Facebook page or follow on Twitter for more questions.It is said “The end justifies the beginning” ,so begin right,prepare well for the interview and crack it. Cracking Angular JS  1.What is AngularJS?AngularJS […]

Categories
Javascript

Tooltip that follows cursor using Directive in AngularJS

How to create a custom tooltip using Directive in AngularJS? Scenario: – Today our target is to create a tooltip which is visible on mouseover an HTML element. Approach: –  We would utilize “Directive” methodology of Angular JS in achieving this. Incase You like our tutorial, please help us to share it with others, do like our FB […]

Categories
Javascript

How to Dismiss angular modal on URL change ?

Requirement :-We have a Angular bootstrap Modal to show a popup window. On clicking backspace / browser back button, we want to cancel the popup and continue with the url change. The default behaviour is that page behind the modal changes, but the modal remains on top.Plunker link for issue GitHub issueSolution :- We have seen lot […]

Categories
Javascript

How to disable Right Click, using Angular JS?

Requirement:- We need to disable Right Click on links in our Angular JS Application? Context-Menu default behaviour Solution:-We wrote a directive to override the default behaviour of “Context Menu”Further we can use this directive to bind specific action on right click, using the contextmenu event.The contextmenu event fires when the user calls the context menu by right-clicking […]