Priya | Eklavya Online

Priya

How can someone set, get, and clear cookies in AngularJS?

AngularJS has a module known as ngCookies. Before we inject ngCookies, we should include angular-cookies.js into the application. Set Cookies We can use the put method to set cookies in a key-value format. $cookies.put(“username”, $scope.username); Get Cookies We can use the get method to get cookies. $cookies.get(‘username’); Clear Cookies We can use the remove method …

How can someone set, get, and clear cookies in AngularJS? Read More »

”How are AngularJS prefixes $ and $$ used?

$$ prefix in AngularJS is used as a private variable, as it is responsible for preventing accidental code collision with the user code. Whereas, $ prefix is used to define angular core functionalities such as variable, parameter, property or method, etc.

What is the Global API in AngularJS?

Global API is the combination of global JavaScript function, which is used to perform tasks such as comparing objects, iterating objects, and converting the data. There are a few common API functions like: angular.lowercase It is used to convert a string to lowercase string. angular.uppercase It is used to convert a string to uppercase string. …

What is the Global API in AngularJS? Read More »

Explain the compilation process of AngularJS?

Angular’s HTML compiler allows us to teach the browser, new HTML syntax. It also allows the developer to attach new behavior or attributes to any HTML element known as directives. AngularJS compilation process automatically takes place in the web browser. It does not contain any server-side or pre-compilation procedure. AngularJS uses <$compiler> service for the …

Explain the compilation process of AngularJS? Read More »

What are the different types of directives available in AngularJS?

AngularJS provides support for creating custom directives for the following type of elements: Element Directive Element directives are activated when a matching element is encountered. Attribute Attribute directives are activated when a matching attribute is encountered. CSS CSS directives are activated when a matching CSS style is encountered. Comment Comment directives are activated when a …

What are the different types of directives available in AngularJS? Read More »

What do you understand by $watch?

In angularJS, $watch() function is used to watch the changes of variable in $scope object. Generally, the $watch() function is created internally to handle variable changes in the application. If there is a need to create custom watch for some specific action then it’s better to use $scope.watch function. The $scope.watch() function is used to …

What do you understand by $watch? Read More »

How will you explain Manual Bootstrap Process in AngularJS?

Sometimes, we may need to manually initialize the Angular application to have more control over the initialization process. We can perform such task using angular.bootstrap() function within angular.element(document).ready() function. AngularJS uses this function when the DOM is ready for manipulation. The angular.bootstrap() function uses two parameters, the document, and the module name injector.

How will you explain Auto Bootstrap Process in AngularJS?

AngularJS initializes automatically upon the “DOMContentLoaded” event. It also initializes when the browser downloads the Angular.js script and document.readyState is set to ‘complete’ at the same time. AngularJS looks for an ng-app directive which is the root of Angular application compilation process. If the directive ‘ng-app’ is found, then AngularJS will perform the following steps: …

How will you explain Auto Bootstrap Process in AngularJS? Read More »