<tr ng-repeat-start="user in users">
<td rowspan=2>{{user.id}}</td>
<td colspan=2>{{user.name}}</td>
</tr>
<tr ng-repeat-end>
<td>{{user.email}}</td>
<td>{{user.phone}}</td>
</tr>
Blog 4 IT beginner to copy and run it : AngularJS, JAVA, C#, JQuery, BootStrap, WPF, WebService, Asp.net, Ajax.net
Thursday, 30 April 2015
AngularJS - How to repeat multiple table rows / any group of HTML element
Saturday, 25 April 2015
Angularjs difference between Services,Factories & Providers
Services
Syntax:
Result: When declaring serviceName as an injectable argument you will be provided with an instance of the function. In other words
module.service( 'serviceName', function );
Result: When declaring serviceName as an injectable argument you will be provided with an instance of the function. In other words
new FunctionYouPassedToService()
.Factories
Syntax:
Result: When declaring factoryName as an injectable argument you will be provided with the value that is returned by invoking the function reference passed to module.factory.
module.factory( 'factoryName', function );
Result: When declaring factoryName as an injectable argument you will be provided with the value that is returned by invoking the function reference passed to module.factory.
Providers
Syntax:
Result: When declaring providerName as an injectable argument you will be provided with
module.provider( 'providerName', function );
Result: When declaring providerName as an injectable argument you will be provided with
ProviderFunction().$get()
. The constructor function is instantiated before the $get method is called - ProviderFunction is the function reference passed to module.provider.
Providers have the advantage that they can be configured during the module configuration phase.
See Example : http://jsbin.com/ohamub/1/edit
Tuesday, 21 April 2015
AngularJS Http Interceptor Example
- under the routing configuration
$httpProvider.interceptors
.push(['$q', '$injector', function ($q, $injector) {
return function (promise) {
return promise.then(function (response) {
return response;
}, function (response) {
if (response.status === 401) {
$injector.get('$state').go('login');
} else if (response.status === 403) {
$injector.get('$state').go('resources');
} else if (response.status === 404) {
$injector.get('$state').go('login');
}
return $q.reject(response);
});
};
}]);
Monday, 20 April 2015
AngularJs Embaded CSS to Html Tag by ng-style
ng-Style will be help to do this
<a ng-style="{ 'background-color' : color, 'background' : color}">
</a>
here color is $scope / $rootScope variable
<a ng-style="{ 'background-color' : color, 'background' : color}">
</a>
here color is $scope / $rootScope variable
Tuesday, 14 April 2015
How do i change user in eclipse svn repository
- open run type %APPDATA%\Subversion\auth\svn.simple
- this will open svn.simple folder
- you will find a file e.g. Big Alpha Numeric file
- Delete that file.
- restart eclipse.
- Try to edit file from projct and commit it
- you can see dialog asking userName password
Difference between $http, $resource & Restangular
$http - $http is built into Angular, so there’s no need for the extra overhead of loading in an external dependency. $http is good for quick retrieval of server-side data that doesn't really need any specific structure or complex behaviours. It’s probably best injected directly into your controllers for simplicity’s sake.
$resource - $resouce is good for situations that are slightly more complex than $http. It’s good when you have pretty structured data, but you plan to do most of your crunching, relationships, and other operations on the server side before delivering the API response. $resource doesn't let you do much once you get the data into your JavaScript app, so you should deliver it to the app in its final state and make more REST calls when you need to manipulate or look at it from a different angle. Any custom behaviour on the client side will need a lot of boilerplate.
Restangular - Restangular is a perfect option for complex operations on the client side. It lets you easily attach custom behaviours and interact with your data in much the same way as other model paradigms you've used in the past. It’s promise-based, clean, and feature-rich. However, it might be overkill if your needs are basic, and it carries along with it any extra implications that come with bringing in additional third-party dependencies.
To Get More Info and example
Subscribe to:
Posts (Atom)