AngularJS-101 Flashcards
What is the parent tag that mekes a web-page angular?
ng-app
Where the other tags must be defined like say ng-controller?
They must be defined along side or as child tag to ng-app
What is a Paragraph tag?
{{var}} it is a placeholder
How can we format a var?
You may use Paragraph tag with the vertical bar:
{{crr_time|date:’h:mm:ss a’}}
Can we have name to ng-app tag?
Yes its good , in case if we have more than one angular app in one page
What is ng-view annotation?
This tells where the dynamic data view should be loaded. Onky ine instance of ng-view is allowed. If we require some dynamism , ng-view is required , other tags will serve static purpose
What is a module?
This is how we define namespace in Angjs. It is like packages in java
How do we define the module
var modName = angular.module(‘modName’, [dependencies]), and then modName will go in ng-app
What is $routeProvider
It tells which controller to load for a url, and which htmk view to show up
What is the syntax for $routeProvider?
var rp = function($routeProvider){$routeProvider.when('/chapter/:id', {controller: 'ctrl', templateUrl : 'template.html'}).when...
Does route supports back and fourth of browser buttone?
Yes
By default which global variable is reached by each ng-directive for their value or function
$scope, and if something is not found then it goes to$rootScope
What is ng-model attribute?
ng-model takes a name , the same name looks into with . operator attached to the $scope
What is $location?
It defines the current url
What is $routeParams
The routeparams passed