CMPE 280 Web UI Design and Development November 8 Class Meeting

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
CS 174: Web Programming April 9 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
SUNY Polytechnic Institute CS 490 – Web Design, AJAX, jQueryAngularJS AngularJS is a client-side JavaScript Framework for adding interactivity to HTML.
Creating a Basic Web Page
May 16 – 18, 2007 Copyright 2007, Data Access Worldwide May 16 – 18, 2007 Copyright 2007, Data Access Worldwide Build Great Web Application 'Fast and Easy'
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
CS 174: Web Programming September 30 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Controllers and Markup Controllers, $scope, Markup, Directives, Expressions, Binding, Filters, Validation SoftUni Team Technical Trainers Software University.
Webview and Web services. Web Apps You can make your web content available to users in two ways in a traditional web browser in an Android application,
Introduction to Angular James Kahng. Terms Framework Template/environment constructed in the language where you fill in details with code Library Set.
Craig Pelkie Copyright © 2015, Craig Pelkie ALL RIGHTS RESERVED Use RPG to Mobilize your IBM i.
CS 160 and CMPE/SE 131 Software Engineering February 11 Class Meeting Department of Computer Science Department of Computer Engineering San José State.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
CMPE 226 Database Systems April 19 Class Meeting Department of Computer Engineering San Jose State University Spring 2016 Instructor: Ron Mak
CS 174: Web Programming October 28 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
AngularJS. What is AngularJS  Javascript Framework  MVC  for Rich Web Application Development  by Google.
National College of Science & Information Technology.
DHTML.
JavaScript, Sixth Edition
Web Programming Anselm Spoerri PhD (MIT) Rutgers University
Web Technologies Computing Science Thompson Rivers University
Unit M Programming Web Pages with
Kendo UI Builder Bob Brennan
Play Framework: Introduction
Unit M Programming Web Pages with
Tutorial 6 Topic: jQuery and jQuery Mobile Li Xu
HTML cont’d Keywords and Tables
CMPE 280 Web UI Design and Development October 26 Class Meeting
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
AngularJS A Gentle Introduction John
CMPE 280 Web UI Design and Development October 19 Class Meeting
CMPE 280 Web UI Design and Development October 24 Class Meeting
CMPE 280 Web UI Design and Development November 7 Class Meeting
CMPE 280 Web UI Design and Development November 7 Class Meeting
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Build Better Apps with MEAN.
The Cliff Notes Version
CMPE 280 Web UI Design and Development January 30 Class Meeting
Jessica Betts, Sophia Pandey, & Ryan Amundson
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
Testing REST IPA using POSTMAN
JavaScript Introduction
MEAN stack L. Grewe.
AngularJS intro L. Grewe.
Angular (JS): A Framework for Dynamic Web Pages
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
CMPE 280 Web UI Design and Development January 30 Class Meeting
Introduction to Programming the WWW I
15 minute break.
Web Development & Design Foundations with H T M L 5
CMPE 280 Web UI Design and Development October 18 Class Meeting
Lesson 1 The Web.
Secure Web Programming
CMPE 280 Web UI Design and Development January 29 Class Meeting
Teaching slides Chapter 6.
Tutorial 7 – Integrating Access With the Web and With Other Programs
Chengyu Sun California State University, Los Angeles
CIS 133 mashup Javascript, jQuery and XML
An Introduction to JavaScript
CMPE 280 Web UI Design and Development April 23 Class Meeting
Web Technologies Computing Science Thompson Rivers University
CMPE 280 Web UI Design and Development May 9 Class Meeting
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
CMPE 135: Object-Oriented Analysis and Design March 14 Class Meeting
Web Client Side Technologies Raneem Qaddoura
05 | An Introduction to AngularJS
CMPE 280 Web UI Design and Development August 27 Class Meeting
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

CMPE 280 Web UI Design and Development November 8 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor: Ron Mak www.cs.sjsu.edu/~mak

Project Oral Presentations PowerPoint slides and live demo At most 15 minutes each. What to present What is your data? What does it contain? What does your information dashboard show? What are the KPIs and why are they important? What decisions will be prompted by your dashboard? Use your website to present the story about your data. Questions and answers The rest of the class will evaluate each presentation by filling out a Canvas survey.

Presentation Schedule Tuesday, April 30 . Thursday, May 2 Tuesday, May 7 . Thursday, May 9

Example Survey Questions How well did the team describe: What its application is about? Who were its clients? Its application architecture and technologies? Its data source and how it was stored? GUI design Organization and navigation design patterns? Layout and list design patterns? Action and user input design patterns? What is the overall quality of the user experience?

Example Survey Questions, cont’d Tell a story about the data What KPIs were displayed in the dashboard? What decisions can be made from the dashboard? How well did the team explain its data visualizations? How well did the team tell its story about the data? Overall, how well did the team do on its demo? How well did the team handle the Q&A?

Project Reports Material from your oral presentation Plus: High-level overview of your application architecture. What client-side, server-side, and database technologies did you use? Where did you get your data? How did you store it? How did you create your data visualizations? What UI design patterns did you implement?

Project Reports, cont’d For the grader: Instructions on how to run your application. Screen shots Zip file of source code (don’t include your data) Final project reports due Monday, May 13

Render the Home Page with Express

MVC Architecture Request-Response Flow

MVC Architecture Data Flow

The MEAN Full Stack Architecture Full stack: All the components of a web app. client side server side database server The MEAN stack MongoDB Express AngularJS (different from Angular 2) Node.js

AngularJS A JavaScript framework for working with data directly on the client side. Traditional web app: App logic and data processing on the server HTML page views and user interactions on the client AngularJS: Move some or all app logic and data processing to the browser. The server’s primary purpose is to access the database.

AngularJS, cont’d jQuery: AngularJS: Provides interactivity to a web page Takes effect after the HTML has been sent to the browser and the Document Object Model (DOM) has completely loaded. AngularJS: Comes in earlier and helps put together the HTML based on the provided data. Two-way data binding

AngularJS Two-Way Data Binding Live view of the data. The view is bound to the model. Immediately update the HTML if the data changes. Immediately update the data if the HTML changes.

AngularJS Two-Way Data Binding, cont’d Traditional: Two-way data binding: Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

JavaScript is the Common Language JSON is the common data format. Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

Single-Page Application (SPA) AngularJS is designed to support SPA functionality. Everything runs inside the browser. application logic data processing template delivery user navigation Never do a full page reload. But slower first page load. Why?

Single-Page Application (SPA), cont’d Greatly reduces the amount of resources needed on the server. Each user’s browser does the hard work. The server basically only serves static pages and data upon request. Better user experience. Fewer calls to the server. Reduced network latency.

Hybrid Applications Example: A blogging application: Blogging interface for users: Not ideal for an SPA Admin interface: Ideal for an SPA Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

Hybrid Applications, cont’d Deliver HTML and content directly from the server. An SPA to write and manage the blogs. Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

Application Design Options Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

AngularJS App Development: Step 1 Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

AngularJS App Development: Step 2 Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

AngularJS App Development: Step 3 Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

AngularJS App Development: Step 4 Getting MEAN with Mongo, Express, Angular, and Node by Simon Holmes Manning Publications, 2015

AngularJS App Development: Step 5

AngularJS App Development: Step 6

AngularJS App Development: Step 7

Network Architectures

Network Architectures, cont’d Scale out MEAN apps with server clusters.

The AngularJS Framework AngularJS is a JavaScript framework. It’s a library written in JavaScript. Include it in your HTML file. Local installation: Download from https://angularjs.org Be sure you get AngularJS and not Angular. From Google: <script src="public/angular/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"> </script>

AngularJS Tutorial See https://www.w3schools.com/angular/default.asp

AngularJS Extends HTML AngularJS extends HTML with ng-directives. The ng-app directive defines an AngularJS application. The ng-model directive binds the value of HTML controls (input, select, textarea) to application data. The ng-bind directive binds application data to the HTML view.

AngularJS Extends HTML, cont’d DataBinding1.html <!DOCTYPE html> <html ng-app> <head>     <script src="public/angular/angular.min.js"></script>     <meta charset="utf-8">     <title>Angular binding test</title> </head> <body>     <input type="text" ng-model="name"            placeholder="Enter your name here"/>     <h1>Hello <span ng-bind="name"></span></h1> </body> </html> ng-model: Bind the value of the input field to the application variable name. ng-bind: Bind the value of the span field to the application variable name. Demo

Expressions Enclose AngularJS expressions with {{ and }} to insert the results into the HTML page: Expression.html <body>     <div ng-app>        <h1>Expression value: {{ 3 + 5 }}</h1>     </div> </body> Demo

Module and Controller Use the Angular function angular.module to create a module. A module is a container for different parts of an application, such as application controllers. Add a controller to the application. Refer to it with the ng-controller directive. Controllers always belong to a module.

Module and Controller, cont’d Controller.html <body> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.firstName= "John"; $scope.lastName= "Doe"; }); </script> <div ng-app="myApp" ng-controller="myCtrl"> First Name: <input type="text" ng-model="firstName"><br> Last Name: <input type="text" ng-model="lastName"><br> <br> Full Name: <strong>{{firstName + " " + lastName}}</strong> </div> </body> ng-app makes the div the owner of the AngularJS app. Use the [] in the module definition to specify dependent modules. Demo

Scope Angular has root scope. Root scope can have child scopes. Contains everything in the application. Implicitly created with the ng-app directive. Root scope can have child scopes. Directive ng-controller implicitly creates one. Adding the controller moved the model out of the root scope and into the controller’s child scope. Scope ties together the view, model, and controller as they all use the same scope.

Scope, cont’d When you make a controller in AngularJS, you pass the $scope object as an argument. If you add properties to the $scope object in the controller, the view (HTML) gets access to these properties. In the view, do not use the prefix $scope, just refer to a property name, like {{carname}}.

Repeating Elements Repeating.html <body>     <div ng-app="" ng-init="names=[         {name:'Jani',country:'Norway'},         {name:'Hege',country:'Sweden'},         {name:'Kai',country:'Denmark'}]">              <h1>Looping with objects</h1>         <table border='1'>             <tr>                 <th>Name</th>                 <th>Country</th>             </tr>             <tr ng-repeat="x in names">                 <td> {{ x.name }} </td> <td> {{ x.country }} </td>         </table>     </div> </body> Ideal for iterating over database query results.

Data Binding DataBinding2.html <body>     <div ng-app="" ng-init="quantity=1;price=5">         <h1>Cost Calculator</h1>         <h2>         Quantity: <input type="number" ng-model="quantity">         Price: $  <input type="number" ng-model="price">         </h2>             Total: ${{quantity * price}}     </div> </body>

Two-Way Data Binding Change the value inside the input field, and the AngularJS property will also change its value. DataBinding3.html <body>     <div ng-app="myApp" ng-controller="myCtrl">         Name: <input ng-model="name">         <h1>You entered: {{name}}</h1>     </div>          <script>         var app = angular.module('myApp', []);         app.controller('myCtrl', function($scope)          {             $scope.name = "John Doe";         });     </script> </body> Change the name inside the input field,  and the name in the h1 header  changes accordingly.

Input Validation InputValidation.html <body>     <form ng-app="" name="myForm">         Email:         <input type="email" name="myAddress" ng-model="text">         <span ng-show="myForm.myAddress.$error.email">             Not a valid e-mail address         </span>     </form> </body> The span displays only if the expression in the ng-show attribute returns true. Only if there is an error in the email address.

CSS Classes Directive ng-model provides CSS classes for HTML elements that depend on their status. CSSclasses.html <head>     <script src="https://ajax.googleapis.com/.../angular.min.js"> </script>     <style>         input.ng-invalid {             background-color: salmon;         }     </style> </head> <body>     <form ng-app="" name="myForm">         Enter your name:         <input name="myName" ng-model="myText" required>     </form> </body>

Model-View-Controller AngularJS applications are controlled by controllers. The model and the view are immediately synchronized. Therefore, the controller can concentrate on the model data. Data binding allows the view will reflect any changes the controller makes to the model

Model-View-Controller, cont’d <body>     <div ng-app="myApp" ng-controller="myCtrl">         <h2>Click on the name to change it.</h2>         <h1 ng-click="changeName()">{{firstname}}</h1>     </div>          <script>         var app = angular.module('myApp', []);         app.controller('myCtrl', function($scope)          {             $scope.firstname = "John";                          $scope.changeName = function()              {                 $scope.firstname = "Nelly";             }         });     </script> </body> MVC.html The controller changes the model (the person’s first name). Data binding automatically updates the view.

Controllers in External Files Follow the MVC architectural guidelines and move the controller code to a separate file. PersonController.js angular.module('myApp', [])        .controller('personCtrl', function($scope)  {     $scope.firstName = "John",     $scope.lastName = "Doe",          $scope.fullName = function()      {         return $scope.firstName + " " + $scope.lastName;     }; });

Controllers in External Files, cont’d Person.html <head>     <script src="https://ajax.googleapis.com/.../angular.min.js"> </script>     <script src="PersonController.js"></script> </head> <body>     <div ng-app="myApp" ng-controller="personCtrl">         <h2>         First name: <input type="text" ng-model="firstName"><br>         Last name:  <input type="text" ng-model="lastName"><br>     </h2>     <h1>         Full name: {{fullName()}}     </h1>     </div> </body>