Premium Essay

Nt1330 Unit 6 Lab Report

Submitted By
Words 465
Pages 2
Understanding watch, watchgroup and watchCollection methods of scope

Posted by Ravi Verma New 0 0 0 0 0

$watch
The $watch functions in Angular are essentially used to basically synchronize the view and the model.The $watch function observes the changes in a variable on the $scope or we can say that it observe the model and when the digest loop runs, it then executes those $watch functions thereby allowing the UI to be updated with those new model property values.
It accepts three parameters: expression, listener and equality object, where listener and equality object are optional parameters.
1
$watch(watchExpression, listener, [objectEquality])
Here, watchExpression is the expression in the scope to watch. This expression is called when the digest loop runs and returns …show more content…
1
2
3
4
5
6
7
8
9
10
11 angular.module("MyApp", []) .controller("MyCtrl",["$scope", "$timeout", function($scope, $timeout) { $scope.colors = ["white","purple","pink"]; $scope.$watchCollection("colors", function(newList, oldList) { console.log("new list: " + newList); console.log("old list: " + oldList); }); $timeout(function() { $scope.colors.push("gray"); }, 2000); }]);
$watchGroup
$watchGroup function is introduced in Angular1.3. It works same as $watch() function but it accept an array of expressions as the first parameter instead of single expression..
1
$watchGroup(watchExpression, listener)
The listener is passed as an array with the new and old values for the watched variables. The listener is called whenever any expression in the watchExpressions array changes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 angular.module("MyApp", []) .controller("MyCtrl",["$scope", "$timeout", function($scope, $timeout) { $scope.message1 = "First Message!"; $scope.message2 = "Second

Similar Documents

Premium Essay

Test

...Institute IS3340 Windows Security Onsite Course SYLLABUS Credit hours: 4.5 Contact/Instructional hours: 60 (30 Theory Hours, 30 Lab Hours) Prerequisite(s) and/or Corequisite(s): Prerequisite: NT2580 Introduction to Information Security or equivalent Course Description: This course examines security implementations for a variety of Windows platforms and applications. Areas of study include analysis of the security architecture of Windows systems. Students will identify and examine security risks and apply tools and methods to address security issues in the Windows environment. Windows Security Syllabus Where Does This Course Belong? This course is required for the Bachelor of Science in Information Systems Security program. This program covers the following core areas:    Foundational Courses Technical Courses BSISS Project The following diagram demonstrates how this course fits in the program:    IS4799 NT2799 IS4670 ISC Capstone Project Capstone ProjectCybercrime Forensics NSA    NT2580 NT2670  Introduction to  Information Security IS4680 IS4560 NT2580 NT2670 Email and Web Services Hacking and Introduction to  Security Auditing for Compliance Countermeasures Information Security Email and Web Services      NT1230 NT1330 Client-Server Client-Server  Networking I Networking II  IS3230 IS3350 NT1230 NT1330  Issues Client-Server Client-Server  SecurityContext in Legal Access Security Networking I Networking II   NT1110  NT1210 Structure...

Words: 2305 - Pages: 10

Premium Essay

Unknown

...Student Name: | Tiffany Walker | Student Name: | Tiffany Walker | Week 1 – Unit 1 NT1330 – Client-Server Networking II Windows Server 2008 Network Services PUBLISHED: June, 2014 Instructor: Scott McCombs | Phone: 440-376-8836 | Email: smccombs.itt.tech@gmail.com | Office Hours: By appointment only | Student Name: ____________________________ PUBLISHED: June, 2014 Instructor: Scott McCombs | Phone: 440-376-8836 | Email: smccombs.itt.tech@gmail.com | Office Hours: By appointment only | Student Name: ____________________________ Build the OSI Model by providing the following information: Layer # | Layer Name | Function | | | | | | | | | | | | | | | | | | | | | | Internet Protocol The Internet Protocol (IP) is the principal communications protocol in the Internet protocol suite for relaying datagrams across network boundaries. Its routing function enables internetworking, and essentially establishes the Internet. IP has the task of delivering packets from the source host to the destination host solely based on the IP addresses contained in the packet. IP defines packet structures that encapsulate the data to be delivered and defines the addressing used to identify the source and destination information. IP is a service in the connection-oriented Transmission Control Protocol (TCP) – thus it is often referred to as the TCP/IP Suite. Two versions of IP: IP Version...

Words: 1730 - Pages: 7