Posts

Showing posts from May, 2023

ANGULAR JS | Form Validation in AngularJS By. Sunrise Computers

Image
  ANGULAR JS | FORM VALIDATION ये form elements(input, select, textarea) के लिए होता है | AngularJS में form को validate किया जाता है | Without Validation Form ये एक Simple Form बनाया गया है | Source Code <html><head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> </head><body ng-app="app" ng-controller="AppController"> <form ng-submit="submit()"> <input type="text" placeholder="Enter name"/><br/><br/> <input type="text" placeholder="Enter Email"/><br/><br/> <input type="submit"> </form> {{onsubmit}} <script> var myapp = angular.module('app', []); myapp.controller('AppController', function($scope) { $scope.submit = function(){ $scope.onsubmit = 'Form is Submitted.'; }; }); </script></body></html> AngularJS में...

ANGULAR JS | Filter & It's Types in AngularJS By. Sunrise Computers

ANGULAR JS ANGULAR JS |  FILTERS AngularJS Filters ये data formatting के लिए इस्तेमाल किया जाता है | Filters का इस्तेमाल expression या directives को pipe character(|) के साथ इस्तेमाल किया जाता है | Syntax {{expression | filter_name : parameter}} Filter Methods number :- Numeric value को string के रूप में format करने के लिए इस्तेमाल किया जाता है | currency :- numeric value को currency में format करने के लिए इस्तेमाल किया जाता है | date :- date को दिए गए format में format किया जाता है | uppercase :- String को uppercase में convert किया जाता है | lowercase :- String को lowercase में convert किया जाता है | ANGULAR JS |  FILTERS | numbers Numeric data को string के रूप में format किया जाता है | Syntax {{expression | number : fraction_size}} Parameter for Number Filter fraction_size : यहाँ पर decimal point के बाद कितने digits चाहिए वो number यहाँ पर दिया जाता है | अगर दिया हुआ expression अगर nuber नहीं होता है तो empty string को return किया जाता है | Source Code  <html>...

ANGULAR JS | Services & It's Types in AngularJS By. Sunrise Computers

  ANGULAR JS ANGULAR JS |  SERVICES AngularJS में बहुत सारी In-Built Services होती है और Custom Services भी बनाई जाती है | AngularJS Service ये Function या Object होता है | Service; Browser द्वारा Server के communication को handle करता है | Angular JS Service ये एक ऐसा Object है जो Web Application की कार्यक्षमता को प्रदान करता है | ANGULAR JS | SERVICES | $anchorScroll $anchorScroll ये service; $location.hash() function पर दिए गए id के मुताबिक उसके called पर scroll किया जाता है | $anchorScrollProvider.disableAutoScrolling() को call करने पर $anchorScroll ये service disabled हो जाती है | Source Code <html><head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <style> .down{ margin-top:2000px; } </style></head><body> <div ng-app="app" ng-controller="ASctrl"> <a href="" id="top" ng-click="toDown()">Click to go to Down</a...

ANGULAR JS | Types of Directives in Angular JS By. Sunrise Computers

ANGULAR JS ANGULAR JS | DIRECTIVES | DIRECTIVES ng-app ng-app directive से AngularJS Application की शुरुआत होती है | ये Application का root element होता है | ये AngularJS को automatically initialize करता है | HTML Document पर सिर्फ एक ही ng-app directive होती है | Syntax 1. <html|body|div ng-app=""> --------- </html|body|div> 2. <html|body|div ng-app="myapp"> --------- </html|body|div> ng-app Attribute's Parameters ng-app = "" : ng-app attribute की value; optional है | value पर module name दिया जाता है | Source Code <html><head> <script src="angularjs.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> </head><body> <div ng-app = "">    Enter Name: <input type = "text" ng-model = "name"><br />   Hello ! <span ng-bind = "name"></span><...

ANGULAR JS | Directives of Angular JS By. Sunrise Computers

  ANGULAR JS ANGULAR JS | DIRECTIVES AngularJS में Directives ये HTML के Elements के लिए Attributes होते है |  जैसे HTML में Element के लिए id, class या style ये attributes होते है |  AngularJS Directives ये HTML को विस्तृत करके और भी कार्यक्षमता प्रदान करता है | AngularJS Directives - ng-app : ये directive AngularJS Application को define करता है | ng-model : ये directive Application data पर form elements(input, textarea, select) को bind करता है | ng-bind : ये directive application variable पर <p> element के innerHTML को bind करता है | Example Source Code <html> <body> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <div ng-app = "" ng-init = "students = ['Lalit','Vikas','Manish','Prince']">     Enter Name: <input type = "text" ng-model = "name"><br />    Hiii ! <span ng-bind = "name.toUpperCase()"...

ANGULAR JS | Introduction & History of Angular JS By. Sunrise Computers

ANGULAR JS ANGULAR JS | INTRODUCTION AngularJS ये light-weighted open-source Javascript framework है | ये MVC(Model-View) based Web Application को बनाने के लिए इस्तेमाल किया जाता है | इस framework में directives, filters और expressions जैसे कुछ components होते है | AngularJS को HTML में इस्तेमाल करना हो तो angular.min.js इस file को include किया जाता है | इस file को online या offline भी include किया जा सकता है | For Example, For Online <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> For Offline : <script src="file_path/angular.min.js"></script> AngularJS को को easily learn करना हो तो HTML,CSS और Javascript का ज्ञान होना जरुरी होता है | ANGULAR JS | WHAT IS ANGULAR JS AngularJS ये Javascript का एक Framework है |  ये free open source framework है | इस Javascript Framework का इस्तेमाल Dynamic Web Applications पर किया जाता है |   AngularJS से HTML को design किया जाता है | ये HTML को और भी बेहतर बना देत...