My friends

Deebhana is friends with Vani Priya

Vani Priya replied to the topic 'How to write login inside a controller?' in the forum. 8 months ago

In Angular logic always goes inside the controller. Below sample shows how we can write logic inside the controller.

<script>
var app = angular.module('gmailModule',[]);
app.controller('mailCourseController', function($scope){

//Arrays
$scope.array =

//Json Object declaration
$scope.mail=[
{mailsubject:'Node JS',description:'New JavaScript framework that helps in web development'},
{mailsubject:'PowerShell Scripting',description:'Another must learn scripting launguage '},
{mailsubject:'PowerBI',description:'Best reporting technology'},
{mailsubject:'Remote Desktop Services',description:'RDS virtualization of apps '}
]

//Expressions
$scope.firstname = 'Satish'
$scope.lastname = 'Kumar'
$scope.fullname = function() {
return $scope.firstName + " " + $scope.lastName;
}
});
</script>

Read More...

Vani Priya replied to the topic 'Can someone give 2or 3 examples for filters?' in the forum. 8 months ago

Apart from Uppercase,Lowercase we also have angular filters on Currency and Arrays.
The currency filters formats number to currency.
Apply filters on arrays that results in pattern matching.

Example:

<html>
<script src=" ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js "></script>
<body>

<div ng-app="myCurrency" ng-controller="currencyCtrl">

<h1>Price: {{ price | currency }}</h1>
<h1>Price: {{ price | currency:"&euro;" }}</h1> //Displays in Euros
<h1>Price: {{ price | currency:"&#8377;" }}</h1> //Displays in Rupies

</div>

<script>
var app = angular.module('myCurrency', []);
app.controller('currencyCtrl', function($scope) {
$scope.price = 100;
});
</script>
</html>

Result: $100
To display in other currency you need provide HTML entity for currency symbols.

Read More...

.Chandra(Admin) is friends with Vani Priya