Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 2.1 KB

README.md

File metadata and controls

36 lines (30 loc) · 2.1 KB

AngularJS-Practice-Modules

Repository has set of folders each one has practice example of basic Angular features.

File : AngularJS Directives

Simple program which displays system time and wish user Good Morning/Good Afternoon/Good Night according to the time.It uses basic AngularJS Directives such as -

  • ng-app : Defines the root element of an application.
  • ng-bind : Binds the content of an HTML element to application data.
  • ng-controller : Defines the controller object for an application.
  • ng-if : Removes the HTML element if a condition is false.
  • ng-click : Specifies an expression to evaluate when an element is being clicked.
  • ng-init : Defines initial values for an application.

ng-model Directive

This folder contain two files. In file 'ng-modelExample.html', we can find how The ng-model directive binds the value of HTML controls to application data.Controls used here are -

  • textbox
  • checkbox
  • radio button
  • date field

TimeApp

This folder has 3 files. It demonstrates AngularJS Scope concept. This program displays time using $scope varible in angular.When you make a controller in AngularJS, you pass the $scope object as an argument. When adding properties to the $scope object in the controller, the view (HTML) gets access to these properties.In the view, you do not use the prefix $scope, you just refer to a propertyname.

Multiplication Tables - Directives Example

It demonstrates some more angular directives such as -

  • ng-change : Specifies an expression to evaluate when content is being changed by the user.
  • ng-hide : Hides HTML elements based on condition.
  • ng-show: Shows or hides HTML elements based on condition.
  • ng-checked : Specifies if an element is checked or not.
  • ng-repeat : Iterates specified block of actions based on condition.

Module Dependencies Example

It demonstrtaes how can we share data between modules. It has 2 modules- 'UserMod' in which a variable is defined and is shared with other module 'dependencies' so that other module can use variable of 'UserMod'.

Calculator App

This folder has 2 files. It demonstrates basic calculator app using Angular JS.