Categories:
  1. Service Portal Introduction
  2. Service Portal Training Content
  3. Service Portal Object
  4. Portal Backend Structure
  5. Portal Module & Element
  6. Service Portal Configuration
  7. Build a new Portal
  8. Create Header Menu
  9. Data Preview from Server Side to HTML
  10. HTML Basic
  11. Get Incident Data & Show in a table
  12. Call HTML to Client Script
  13. Call Server Side Script for Action
  14. ServiceNow OOB Widget Provide for Portal
  15. Javascript popup VS SPModal
  16. spUtil – Client Dependency Service Portal
  17. Widget Embedded
  18. Send data from one widget to another
  19. GlideSPScriptable API on Server Side
  20. Angular Template
  21. $location, $timeout, $uibModal & $watch Services
  22. Use HTTP Service or REST Call on ServicePortal
  23. Angular Directive & Angular Filter
  24. Create a custom list widget with pagination, order, and filter
  25. ServiceNow Custom Component(Reference & Date Fields) in Service Portal
  26. Localization
  27. Create Own Theme
  28. Angular Provider & Dependency
  29. Service Portal Additional Details

Angular Directive Important Directive

  • ng-if
  • ng-repeat
  • ng-show
  • ng-hide
  • ng-click
  • ng-src
  • ng-model
  • ng-bind
  • ng-bind-html
  • ng-init

NG-Repeat Aditional Parameter

  • $index
  • $even
  • $odd
  • $first
  • $last
  • $middle

Example:

<h1 ng-repeat="x in records"><p ng-if="$index == '1'">{{x}}</p></h1>

Angular Filter:

  • {{ object | limitTo : limit : begin }}
  • {{ lastName | uppercase }}
  • {{ lastName | lowercase }}
  • Filter is used to search element – ng-repeat=”x in cars | filter : ‘A'”
  • $scope.filteredText = $filter(‘uppercase’)($scope.originalText);
  • {{ orderBy_expression | orderBy : expression : reverse : comparator}} // reverse:true| false
  • To Fixed two digits in float {{obj | number : 2}}
  • {{ currency_expression | currency : symbol : fractionSize}} – {{ price | currency : “$” : 3}}

Example:

<span ng-click="displayFilter='all'">${All} </span> | <span ng-click="displayFilter='incident'">${Issues}</span>
<div ng-repeat="item in c.data.records | unique: 'data.sys_id' | orderBy: 'data.sys_created_on' : true | filter: filterItems">
$scope.displayFilter = "all";	
$scope.filterItems = function (item) { 
	if ($scope.displayFilter=='all') {
		return true;
	} else {
			return item.type == $scope.displayFilter;
	}

Total Views: 1367

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *