Skip to main content

Posts

Showing posts from December, 2014

How to format a date-time column in ng-grid?

This is ng-grid date forma t The code-sample as given below. ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 angular.module( 'userApp' , [ 'ngGrid' ]).controller( 'myCtrl' , function ($scope) {    $scope.users = myData;     $scope.userColumns = [              { field: 'ContactName' , displayName: 'User Name' },              { field: 'ContactEmail' , displayName: 'Email' },              { field: 'ContactMobile' , displayName: 'Mobile' },              { field: 'AlertOptIn' , displayName: 'AlertOptIn' },              { field: 'LastUpdateBy' , displayName: 'LastUpdateBy' },              { field: 'LastUpdateDate' , displayName: 'LastUpdateDate' , cellFilter: "date: 'yyyy-MM-dd' }];    $scope.userGridView = {          data: 'users' ,          columnDefs: 'userColumns&#

Access MVC 5 Web API 2 in AngularJs

The Table of Contents  The Reference file URLs.  The HTML code-sample  The AngularJs code- sample  The Reference file URL s. ? 1 2 3 4 5 <link rel= "stylesheet" type= "text/css" href= " http://angular-ui.github.com/ng-grid/css/ng-grid.css " /> <script src= " https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js " ></script> <script src= "//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.1/angular.min.js" ></script> <script type= "text/javascript" src= " http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js " ></script> <script src= "~/Scripts/app/CustonPlugins/ng-grid.csv.export.plugin.js" ></script> <link rel="stylesheet" type="text/css" href="http://angular-ui.github.com/ng-grid/css/ng-grid.css" /> <script src="https://ajax.googleapis.com/ajax/lib

How to use the $http.get() and $http.post() services in angularjs?

In this topic I am going to share the use the GET method and POST services method in AngularJs. So look at given below code-sample. The Table of Contents 1. The $http.get()  Services  2. The $http.post()  Services  The $http.get() Service s ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 var app = angular.module( 'userApp' , []); app.service( 'userService' , function ($http) {      delete $http.defaults.headers.common[ 'X-Requested-With' ];      this .getUsers = function () {          // $http() GETmethod returns a $promise that we can add handlers with .then() function.          return $http({              method: 'GET' ,              url: ' http://localhost:56110/APIs/Setting/Get '                     });      } }); app.controller( 'GetUserCtrl' , function ($scope, userService) {      $scope.users = null ;      userService.getUsers().

AngularJs Multiple Controllers on one View Page

Introduction Today's I am going to share the code-sample for how to call or use multiple controllers on one view. I am very excited to share this interesting topic.  Table of Contents 1. The HTML code-sample  2. The AngularJs code-sample  3. The Full Example code-sample  The HTML code-sample ? 01 02 03 04 05 06 07 08 09 10 11 12 13 <div ng-controller= "MainCtrl" >    <div class= "row-fluid" >      <div class= "span6" >        Do something main here..      </div>    </div>    <div ng-controller= "SubDiv1Ctrl" >      Do something sub 1 here..    </div>    <div ng-controller= "SubDiv2Ctrl" >      Do something sub 2 here..    </div> </div> <div ng-controller="MainCtrl"> <div class="row-fluid"> <div class="span6"> Do something main here..

Export ng-grid data to Excel, CSV and PDF format in angularjs

In the 1st Step, we write a plug-In class for exporting ng-grid data to CSV, excel and PDF formats. In this plug-In, we add the export CSV link in footer tab.  Stayed Informed – Angular2 ng-if else Stayed Informed – Angular2  ng-show The name of plug-In class is " pluginNgGridCVSExport " which are give below . ? 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 function pluginNgGridCVSExport(options) {      var self = this ;      self.grid = null ;      self.scope = null ;      self.init = function (scope, grid, services) {          self.grid = grid;          self.scope = scop