CSS
Cascading Style Sheets (CSS) is a simple design language released
in 1996, CSS describes how HTML elements are to be displayed on screen, paper,
or in other media.
CSS 3
CSS3 version introduced new features that allowed
developers to style HTML elements with less CSS code.
CSS3 features
Easy to use
CSS3 allows developers to style HTML elements easier.
Responsive design
CSS3 is the latest version, hence it supports responsive
design.
Box Shadow
One of the CSS3 new features is the box-shadow property
that adds a shadow to an element. Instead of using multiple images around an
item, this property lets you add shadow with a short line of code.
Separate reusable modules
CSS3 can be breakdown into modules.
Attribute Selectors
CSS3 also introduced new selectors in addition to the ones
in CSS2. Instead of applying IDs or classes for styling, developers can select
HTML elements according to their attributes.
Performance and speed
CSS3 is faster than basic CSS.
Animation
Animation and 3D transformations are supported
Compatibility
CSS3 is backwards-compatible with former CSS versions. It
means that CSS3 features work on web pages using older CSS. Browsers that
support CSS2 also represent the modifications with CSS3..
Color
CSS3 supports HSL RGBA, HSLA and the gradient colors. i.e.
#fff supported.
Rounded corners
CSS3 provide codes for setting rounded gradients and
corners
Text shadow and effects
CSS3 has many advance features like text shadows, visual
effects, and a wide range of font style and color.
Opacity
One of the CSS3 properties called opacity makes elements
see-through or completely transparent.
Introduction
Localization and internationalization is common requirement of large organizations to create website or web application that is available in multiple countries.
What is Localization?
Localization is the adaptation of a product or service (i.e. website, web application) to meet the needs of a particular language, culture or desired population's "look-and-feel”.
Angular Localization
You can use Localization module for your angular app to add localization feature in your application for multiple languages.
Localizable pluralization is supported via the ngPluralize directive.Additionally, you can use MessageFormat extensions to $interpolate for localizable pluralization and gender support in all interpolations via the ngMessageFormat module.
All localizable Angular components depend on locale-specific rule sets managed by the $localeservice.
Following are steps some steps required to add localization in your application,
1. You have to download libraries and include them in the project.
2. Then provide translation files and set them working.
3. In this step change angular $locale after the language change.
Simple example
Add three views one for home page another two for English US and German language.
1. Create main view named "Home.html" and other two views(english and german) named "index.html" under en_us/de_de folder.
2. Add angular js file.
3. Add AngularJS English localization file in english view.
4. Add AngularJS German localization file in german view.
5. Add AngularJS model and controller code.
Home View
<!DOCTYPE html>
<html>
<body>
<div ng-app="mainApp" ng-controller="myLocalizationController">
<h3>Select the localization:</h3>
<a href="en_us/">English (USA)</a><br />
<a href="de_de/">German (Germany)</a>
</div>
</body>
</html>
English View
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../Content/js/angular.min.js"></script>
<script src="../Content/js/angular-locale_en-us.js"></script>
<script src="../Content/js/LocalizationController.js"></script>
<title>English Employee Data</title>
</head>
<body>
<div ng-app="mainApp" ng-controller="myLocalizationController">
User Name:{{Employee.Name | uppercase}}
<!--date -->
Birth Date:{{Employee.BirthDate | date:'medium' }}
<!--number -->
Package:{{Employee.Package | number }}
<!--currency -->
<p>Payment: {{Employee.Payment | currency}}</p>
</div>
</body>
</html>
German View
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../Content/js/angular.min.js"></script>
<script src="../Content/js/angular-locale_de-de.js"></script>
<script src="../Content/js/LocalScript.js"></script>
<title>German Employee Data</title>
</head>
<body ng-app="mainApp">
<div ng-controller="myLocalizationController">
User Name:{{Employee.Name | uppercase}}
<!--date -->
Birth Date:{{Employee.BirthDate | date:'medium' }}
<!--number -->
Package:{{Employee.Package | number }}
<!--currency -->
<p>Payment: {{Employee.Payment | currency}}</p>
</div>
</body>
</html>
AngularJS Controller and Model Code
angular.module("mainApp", ["ngLocale"])
.controller("myLocalizationController", function ($scope, $locale) {
// Store the current locale ID in a variable
$scope.localeId = $locale.id;
// Store the current date/time in a variable
$scope.currentDate = new Date();
$scope.Employee = {
id: 1,
Name: 'Shourya Kendre',
BirthDate: dateOut,
Package: 52503.30,
Payment: 700
};
});
धन्यवाद मित्रानो, आपला प्रत्येक दिवस आनंदी आणि सुखी जावो
In this post I will cover with example how to create a JSON based WCF Rest Web Service and use this with angular web application.
Rest Web Service
RESTful Web Services are web services that follws REST architecture. In REST Architecture everything is a resource.
Following are core advantages using rest web services
Light weight
Scalable
Maintainable
Example:
In this example with the assumption that REST based service is already in place to retrieve the doctors and add doctor’s data, we will write the angular application using this WCF web service.
Angular Service created using Factory
var DoctorService = angular.module('DoctorService', [])
DoctorService.factory('DoctorsDataOp', ['$http', function ($http) {
var urlBase = 'http://localhost:54393/Service1.svc';
var DoctorDataOp = {};
DoctorDataOp.getDoctors = function () {
return $http.get(urlBase + '/GetallDoctors');
};
DoctorDataOp.addDoctors = function (doct) {
return $http.post(urlBase + '/AddDoctors', doct);
};
return DoctorDataOp;
}]);
There are two methods first method “getDoctors” retrieves all doctors data using the $http.get and Second method add doctors using the $http.post. In the service we are using other inbuilt angular service $http to make the call to the service.
Angular Controller
var myApp = angular.module('myDoctorApp', ['DoctorService']);
myApp.controller('DoctorController', function ($scope, DoctorDataOp) {
$scope.status;
$scope.doctors;
getDoctors();
function getDoctors() {
DoctorDataOp.getDoctors()
.success(function (dcts) {
$scope.doctors = dcts;
})
.error(function (error) {
$scope.status = 'Unable to load doctors data: ' + error.message;
});
}
$scope.addDoctor = function () {
var doct = {
ID: 1,
Name: $scope.Name,
Phone: $scope.Phone,
Address: $scope.Address
};
DoctorDataOp.addDoctor(doct)
.success(function () {
$scope.status = 'Inserted Doctor Suceessfully!';
$scope.doctors.push(doct);
}).
error(function (error) {
$scope.status = 'Unable to insert Doctor: ' + error.message;
});
};
});
In the controller we are using “getDoctors” and “addDoctors” functions to scope. As it is clear from the name that these functions are used to fetch doctors and add doctors data respectively. As a dependency DoctorSevice module is passed in the module and in the controller we are passing the DoctorDataOp service as the dependency.
Angular View
In following view there are two sections first section used add new doctors data and second section simply displays doctors data using ng-repeat directive.
In the input form we are setting Name, Phone and Address properties on the $scope object and then calling addDoctor () function of the controller to add a doctors data to the database.
<html>
<head>
<title></title>
<script src="~/Content/js/angular.min.js"></script>
<script src="Content/js/AngularRestService.js"></script>
<script src="Content/js/DoctorController.js"></script>
</head>
<body>
<div ng-app="myDoctorApp" ng-controller="DoctorController">
<form class="well">
<input type="text" name="name" ng-model="Name" placeholder="doctor name" /> <br/>
<input type="text" name="phone" ng-model="Phone" placeholder="doctor phone" />
<input type="text" name="address" ng-model="Address" placeholder="doctor address" />
<br /><br/>
<input type="button" value="add doctor" ng-click="addDoctor()" />
</form>
<br/>
<table class="table">
<tr ng-repeat="d in doctors">
<td>{{ d.Name }}</td>
<td>{{ d.Phone }}</td>
<td>{{ d.Address }}</td>
</tr>
</table>
</div>
</body>
</html>
धन्यवाद मित्रानो !! Thanks Friends !!