@ScotHillier (function () { }());

Slides:



Advertisements
Similar presentations
@ScotHillier Web Parts Workflows Pages Libraries App Parts SharePoint-Hosted Apps Provider-Hosted Apps.
Advertisements

SharePoint and Knockout for the REST of Us
Extreme User Interfaces for Alfresco Kevin Dorr Sr. Solutions Engineer Americas Channel.
@ScotHillier Web Parts Workflows Pages Libraries App Parts SharePoint-Hosted Apps Provider-Hosted Apps.
Introduction to MVC Action Methods, Edit View, and a Search Feature NTPCUG Dr. Tom Perkins.
Javascript and AJAX Willem Visser RW334. Overview Javascript jQuery AngularJS AJAX.
Advanced Object-Oriented Programming Features
XMLHttpRequest Object and XML What we should learn in this lesson –What is the XHR object? –How to create the XHR objects? –XHR object properties –XHR.
Migrating Full-Trust Solutions to the Cloud Scot
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Understanding SharePoint 2013 Add-In Security Vulnerabilities
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Application Development Description and exemplification of server-side scripting language for server connection, database selection, execution of SQL queries.
User Interface Design using jQuery Mobile CIS 136 Building Mobile Apps 1.
Interactive Web Application with AJAX
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
CGI and AJAX CS-260 Dick Steflik.
PHP and AJAX ISYS 475. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net,
SUNY Polytechnic Institute CS 490 – Web Design, AJAX, jQueryAngularJS AngularJS is a client-side JavaScript Framework for adding interactivity to HTML.
JavaScript & jQuery the missing manual Chapter 11
@ScotHillier Studies/SearchResult.aspx?q=hillier.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Phonegap Bridge – Telephony CIS 136 Building Mobile Apps 1.
AJAX and Java ISYS 350. AJAX Asynchronous JavaScript and XML: – Related technologies: JavaScript, Document Object Model, XML, server-side script such.
AngularJS Routing Routes, Route Parameters, Templates, Location, Navigation SoftUni Team Technical Trainers Software University
JaxDUG March Who am I  David Fekke  Web Applications and iOS Apps   JaxDUG, JSSUG, JaxJUG and.
Asterisk based real-time social chat Advisor : Lian-Jou Tsai Student : Jhe-Yu Wu.
@ScotHillier Web Parts Workflows Pages Libraries App Parts SharePoint-Hosted Apps Provider-Hosted Apps.
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
AJAX محمد احمدی نیا 2 Of 27 What is AJAX?  AJAX = Asynchronous JavaScript and XML.  AJAX is not a new programming language, but.
Controllers and Markup Controllers, $scope, Markup, Directives, Expressions, Binding, Filters, Validation SoftUni Team Technical Trainers Software University.
INTEGRATION OF BACKBONE.JS WITH SPRING 3.1. Agenda New Features and Enhancements in Spring 3.1 What is Backbone.js and why I should use it Spring 3.1.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
AJAX Asynchronous JavaScript & XML A short introduction.
Creating Dynamic Webpages
SYST Web Technologies SYST Web Technologies AJAX.
AngularJS AJAX.
Canopy walk through Single-Page Apps (SPAs) Benjamin Howarth Freelancer, Code Gecko Umbraco UK Festival, Fri 30 th Oct 2015 CODE GECKO.
Integrating Yammer with SharePoint Alan Marshall and Rebecca Gordon
Krishna Mohan Koyya Glarimy Technology Services
Web Programming JAvaScript Ajax Programming Web Programming /38.
CHAPTER 13 COMMUNICATING WITH AJAX. LEARNING OBJECTIVES AJAX, which stands for Asynchronous JavaScript and XMLprovides a way for a browser to send and.
Angular 2.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
Step 1of 11 Admin Demonstrations Click Here to Start.
function myPromise() { var deferred = $.Deferred(); setTimeout(function() { deferred.resolve("success!"); }, 1000); return deferred.promise();
SHAREPOINT SATURDAY PRESENTATION by Keith Rimington REAL EXPERIENCES WITH ANGULARJS AND SHAREPOINT.
JQuery form submission CIS 136 Building Mobile Apps 1.
David Tarrant Electronics and Computer Science.
CITA 330 Section 10 Web Remoting Techniques. Web Remoting Web Remoting is a term used to categorize the technique of using JavaScript to directly make.
How to consume a RESTful service using jQuery. Introduction  In this post we see how to consume the RESTful service described in the post Design a RESTful.
AJAX. Objectives Understand and apply AJAX Using AJAX in DOJO library.
Extreme User Interfaces for Alfresco Kevin Dorr Sr. Solutions Engineer Americas Channel.
AngularJS. What is AngularJS  Javascript Framework  MVC  for Rich Web Application Development  by Google.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
ANGULAR 2. JavaScript is a high-level, dynamic, untyped, and interpreted programming language. JavaScript was originally developed in May 1995 by Brendan.
Introduction to AJAX Pat Morin COMP Outline What is AJAX? – History – Uses – Pros and Cons An XML HTTP Transaction – Creating an XMLHTTPRequest.
WWU Hackathon May 6 & 7.
AJAX AJAX = Asynchronous JavaScript and XML.
SPC Developer 6/10/2018 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
JavaScript & AJAX.
CIS 136 Building Mobile Apps
jQuery form submission
Working with different JavaScript frameworks and libraries
Office 365 Development.
Lecture 12: The Fetch Api and AJAx
Angular 2 : CRUD Operations
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Presentation transcript:

@ScotHillier

(function () { }());

var Wingtip = window.Wingtip || {}; Wingtip.Customer = { name: "Brian Cox", speak: function () { alert("My name is " + this.name); } }; Wingtip.Customer.speak();

var Wingtip = window.Wingtip || {}; Wingtip.Module = Wingtip.Module || {}; Wingtip.Module.Customer = function () { //private members var name, setname = function (n) { name = n; }, getname = function () { return name; }, talk = function () { alert("My name is " + name); }; //public interface return { set_name: setname, get_name: getname, speak: talk } }();

window.Wingtip = window.Wingtip || {}; Wingtip.Customer = function (n) { this.name = n }; Wingtip.Customer.prototype = { get_name: function () { return this.name; }, set_name: function (n) { this.name = n; }, speak: function () { alert("My name is " + this.name); } }; var customer = new Wingtip.Customer("Brian Cox"); Customer.speak();

scope Input type Return type scopetype private getQueryStringParameter(p: string): string {... }; private displayName: string = "Scot";

module Wingtip { … }

class Welcome { //private members private displayName: string = "Scot Hillier"; private pictureUrl: string = "/images/sh.jpg"; //public methods public get_viewModel() { return { "pictureUrl": Welcome.pictureUrl, "displayName": Welcome.displayName }; }

module Wingtip { //Namespace interface WelcomeData { pictureUrl: string; displayName: string; } export class Welcome { public get_viewModel(): WelcomeData { return { "pictureUrl": Welcome.pictureUrl, "displayName": Welcome.displayName }; }

<NavigationProperty Name="RootWeb" …

var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState === 4 && xmlhttp.status === 200) { var results = JSON.parse(xmlhttp.responseText).d.results; for (var i = 0; i < results.length; i++) { var title = results[i].Title; } }; var url = "../_api/web/lists/getByTitle('Contacts')/items"; xmlhttp.open("GET", url, false); xmlhttp.setRequestHeader("accept", "application/json;odata=verbose"); xmlhttp.send();

jqXHR is a superset of XMLHttpRequest status is a string message is a string data is a JSON object jQuery.ajax({ url: "../_api/web/lists/getByTitle('Contacts')/items", type: "GET", headers: { "accept": "application/json", }, success: function (data, status, jqXHR) { }, error: function (jqXHR, status, message) { } });

jQuery.ajax({ url: "../_api/web/lists/getByTitle('Contacts')/items", type: "POST", contentType: "application/json", data: JSON.stringify({ '__metadata': { 'type': 'SP.Data.ContactsListItem' }, 'Title': lname, 'FirstName': fname, 'WorkPhone': wphone, ' ': }), headers: { "accept": "application/json;", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() }, success: function (data, status, jqXHR) { }, error: function (jqXHR, status, message) { } });

jQuery.ajax({ url: "../_api/web/lists/getByTitle('Contacts')/items(" + Id + ")", type: "POST", contentType: "application/json ", data: JSON.stringify({ __metadata': { 'type': 'SP.Data.ContactsListItem' }, 'FirstName': fname }), headers: { "accept": "application/json", "X-HTTP-Method": "MERGE", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val(), "If-Match": eTag }, success: function (data, status, jqXHR) { }, error: function (jqXHR, status, message) { } });

jQuery.ajax({ url: "../_api/web/lists/getByTitle('Contacts')/items(" + Id + ")", type: "DELETE", headers: { "accept": "application/json", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val(), "If-Match": "*“ }, success: function (data, status, jqXHR) { }, error: function (jqXHR, status, message) { } });

Create a Deferred Return the Promise Resolve or Reject function myPromise() { var deferred = $.Deferred(); setTimeout(function () { deferred.resolve("success!"); }, 1000); return deferred.promise(); } myPromise().then( function (value) { alert(value); }, function () { alert("error!"); } );

public class CustomersController : EntitySetController { List customers = new List () { new Customer() { Id=1, LastName="Doyle", FirstName="Patricia" }, new Customer() { Id=2, LastName="Burke", FirstName="Brian" } }; [Queryable] public override IQueryable Get() { return customers.AsQueryable(); } protected override Customer GetEntityByKey(int Id) { return (from c in customers where c.Id == Id select c).FirstOrDefault(); }

ODataModelBuilder builder = new ODataConventionModelBuilder(); builder.EntitySet ("Customers"); IEdmModel model = builder.GetEdmModel(); config.Routes.MapODataRoute("CustomersRoute", "odata", model);

$.ajax( { url: " + id + ")", type: "GET", headers: { "accept": "application/json", }, success: onSuccess, error: onError } );

Contacts.html First Name Last Name Id First Name Last Name Id Scot Hillier 1

Module Routes ViewController DirectivesFactory $scope

//module var myapp = angular.module("MyApp", []);

//module Wingtip.App = angular.module("App", ["ngRoute"]); Wingtip.App.config(["$routeProvider", function ($routeProvider) { $routeProvider. when("/welcome", { templateUrl: "partials/welcome.html", controller: "welcomeCtrl“ }). otherwise({ redirectTo: "/“ }); }] ); Rendered here Route module Partial page

Initializes the app. Can be anonymous or named. Creates a property on the ViewModel References a controller named “myCtrl”, which creates a new ViewModel. References a controller method to call on a click event

{{firstName}} Display whatever the user types

{{firstName | uppercase}} Display data in all caps

Build up the $scope (a.k.a, View Model) //controller myapp.controller("welcomeCtrl", ["$scope", function welcomeCtrl($scope) { //model $scope.welcomeMessage = "Hi"; }] );

Bind the $scope to the HTML elements {{welcomeMessage}}

Allows common functionality to be factored out into a single component and used by many Controllers Defined by the Module in the same way Controllers are defined The new Factory is injected into Controllers Wingtip.App.factory("welcomeService", function () { var welcomeService = {}; welcomeService.greet = function () { alert("Hi!"); }; return welcomeService; } ); Wingtip.App.controller("myCtrl", ["$scope", "welcomeService", function contactsCtrl($scope, welcomeService) { welcomeService.greet(); }] );

82

84