Hands on Angular Framework

Similar documents
7tema DISTRIBUTED SYSTEMS

welcome to BOILERCAMP HOW TO WEB DEV

By the end of this Angular 6 tutorial, you'll learn by building a real world example application:

Introduction to. Angular. Prof. Dr.-Ing. Thomas Wiedemann.

Angular 2 Programming

a Very Short Introduction to AngularJS

Asynchronous Communication using Messaging

IN4MATX 133: User Interface Software

Decoupled Drupal with Angular

P a g e 1. Danish Technological Institute. Scripting and Web Languages Online Course k Scripting and Web Languages

One Framework. Angular

Integrating Angular with ASP.NET Core RESTful Services. Dan Wahlin

AngularJS Fundamentals

Chapter 1 - Development Setup of Angular

Ten interesting features of Google s Angular Project

Index. Elad Elrom 2016 E. Elrom, Pro MEAN Stack Development, DOI /

Financial. AngularJS. AngularJS. Download Full Version :

Frontend UI Training. Whats App :

Financial. AngularJS. AngularJS.

ANGULAR 2.X,4.X + TYPESRCIPT by Sindhu

Full Stack boot camp

Angular 4 Training Course Content

"Charting the Course... Comprehensive Angular. Course Summary

Lab 1 - Introduction to Angular

mongodb-tornado-angular Documentation

Salvatore Rinzivillo VISUAL ANALYTICS

Before proceeding with this tutorial, you should have a basic understanding of HTML, CSS, JavaScript, TypeScript, and Document Object Model (DOM).

Comprehensive AngularJS Programming (5 Days)

Modern and Responsive Mobile-enabled Web Applications

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

International Research Journal of Engineering and Technology (IRJET) e-issn: Volume: 05 Issue: 05 May p-issn:

Advance Mobile& Web Application development using Angular and Native Script

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

Angular 2 and TypeScript Web Application Development

Dreamweaver 101. Here s the desktop icon for Dreamweaver CS5: Click it open. From the top menu options, choose Site and New Site

WebStorm, intelligent IDE for JavaScript development

IONIC. The Missing SDK For Hybrid Apps. Mike

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

MarkLogic Server. Reference Application Architecture Guide. MarkLogic 9 May, Copyright 2017 MarkLogic Corporation. All rights reserved.

"Charting the Course... Comprehensive Angular 6 Course Summary

MEAN February. techdt.la

AngularJS Intro Homework

Guides SDL Server Documentation Document current as of 04/06/ :35 PM.

Tools for Accessing REST APIs

PHP WITH ANGULAR CURRICULUM. What you will Be Able to Achieve During This Course

Front End. Presentation Layer. UI (User Interface) User <==> Data access layer

EXPRESSIONS IN ANGULARJS

Practical Course: Web Development Angular JS Part I Winter Semester 2016/17. Juliane Franze

Getting started with Tabris.js Tutorial Ebook

Getting MEAN. with Mongo, Express, Angular, and Node SIMON HOLMES MANNING SHELTER ISLAND

Ionic Tutorial. For Cross Platform Mobile Software Development

Human-Computer Interaction Design

WorldSpace Attest Quick Start Guide

Cross-Platform Mobile-Entwicklung mit dem Ionic Framework

CodeValue. C ollege. Prerequisites: Basic knowledge of web development and especially JavaScript.

Kendo UI. Builder by Progress : Using Kendo UI Designer

Course Outline. ProTech Professional Technical Services, Inc. Comprehensive Angular 7 Course Summary. Description

,

Unit 3 - Week 2 lectures: Building your webapp

Objective % Select and utilize tools to design and develop websites.

Web Development for Dinosaurs An Introduction to Modern Web Development

Modern SharePoint and Office 365 Development

Software. Full Stack Web Development Intensive, Fall Lecture Topics. Class Sessions. Grading

Designing the Home Page and Creating Additional Pages

Full Stack Web Developer Nanodegree Syllabus

Lab 1: Getting Started with IBM Worklight Lab Exercise

Setting up an Angular 4 MEAN Stack (Tutorial)

Guides SDL Server Documentation Document current as of 05/24/ :13 PM.

Virto SharePoint Forms Designer for Office 365. Installation and User Guide

BUILD YOUR OWN SAP FIORI APP IN THE CLOUD Exercise Week 5

Frontend Frameworks. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Installing VS Code. Instructions for the Window OS.

Forerunner Mobilizer Dashboards

What is Node.js? Tim Davis Director, The Turtle Partnership Ltd

3 Days Training Program

MASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M

Html5 Css3 Javascript Interview Questions And Answers Pdf >>>CLICK HERE<<<

Lesson 7: Recipe Display Application Setup Workspace

Online. Course Packet PYTHON MEAN.NET

Full Stack Web Developer

SAURASHTRA UNIVERSITY

Build CA Plex Web/Mobile App

"Charting the Course... Comprehensive Angular 5. Course Summary

Node.js. Node.js Overview. CS144: Web Applications

August, HPE Propel Microservices & Jumpstart

Angular University Learn and Keep Up With The Angular Ecosystem

Creating and Publishing Faculty Webpages

Open Source Library Developer & IT Pro

Simple AngularJS thanks to Best Practices

Angular 4 Syllabus. Module 1: Introduction. Module 2: AngularJS to Angular 4. Module 3: Introduction to Typescript

Front End Programming

Application Development in Web Mapping 1.

Getting Started with ReactJS

Tools. SWE 432, Fall Design and Implementation of Software for the Web

About Me. Name: Jonathan Brown. Job: Full Stack Web Developer. Experience: Almost 3 years of experience in WordPress development

Course 1: Microsoft Professional Orientation: Front-End Web Developer

Tutorial 4 Data Persistence in Java

POWER BI BOOTCAMP. COURSE INCLUDES: 4-days of instructor led discussion, Hands-on Office labs and ebook.

Exercise 1. Bluemix and the Cloud Foundry command-line interface (CLI)

Full Stack Web Developer

Transcription:

FACULTY OF AUTOMATION AND COMPUTER SCIENCE COMPUTER SCIENCE DEPARTMENT Hands on Angular Framework Ioan Salomie Tudor Cioara Ionut Anghel Marcel Antal Teodor Petrican Claudia Daniela Pop Dorin Moldovan Ciprian Stan Stallation Guide 1 P a g e

Contents Table of Figures... 2 1. Introduction... 3 1.1. Stack of Resources... 3 1.2. Get the project... 3 1.3. Run the project... 5 1.4. Project Structure... 6 2. Project Conceptual Architecture... 7 3. Project Functionality... 8 4. Testing the Project... 12 5. Reinforcement Learning... 12 6. References... 12 Table of Figures Figure 1-Project Structure... 4 Figure 2-Welcome Page... 6 Figure 3-Project Structure Details... 6 Figure 4-Project Conceptual Architecture... 7 Figure 5-Sequence Diagram for Retrieving All Users... 8 Figure 6-Snippet from index.html... 8 Figure 7-Call the method getusers()... 9 Figure 8-Snippet from header.component.ts... 9 Figure 9-Code Snippet from HeaderComponent... 9 Figure 10-Snippet from app.module.ts... 10 Figure 11-Code Snippet from UserService... 10 Figure 12-Snippet from user.service.ts... 11 Figure 13-Code Snippet from UsersComponent... 11 Figure 14-Snippet from app.module.ts... 11 Figure 15-Display All Users... 12 2 P a g e

1. Introduction Angular is a platform that can be used for building web applications. The development challenges are solved by combining: Declarative templates End to end tooling Dependency injection Integrated best practices 1.1. Stack of Resources Install and configure the following resources: Node.js and Node Package Manager (NPM) Install the last versions from https://nodejs.org/ and check that Node and NPM are installed using the commands: node -v npm -v Angular CLI Install the last version from https://cli.angular.io/: npm install --save-dev @angular/cli@latest WebStorm Download WebStorm from https://www.jetbrains.com/webstorm/ NGINX Download the stable version of NGINX from http://nginx.org/en/download.html 1.2. Get the project 1. Setup GIT and download the project from https://utcn_dsrl@bitbucket.org/utcn_dsrl/angular-demo.git Create an empty local folder in the workspace on your computer Right-click on the folder and select Git Bash Write the commands: o git init o git remote add origin https://utcn_dsrl@bitbucket.org/utcn_dsrl/angulardemo.git o git pull origin master 2. In WebStorm select File and Open 3 P a g e

3. Search for the location of the project on the disk, enter the name of the project angulardemo and click OK. 4. The structure of the project can be seen below. Figure 1-Project Structure 4 P a g e

1.3. Run the project 1. From WebStorm open the terminal using View, Tool Windows and Terminal. 2. Download the packages writing the following command in the terminal: npm install 3. Build the project using the following command from terminal: ng build --prod 4. Run the project using one of the following two alternatives: Alternative 1 Run the application in WebStorm In the WebStorm terminal write the command: ng serve --open Alternative 2 Run the application from NGINX Copy and paste the files from angular-demo/dist/angular-demo to nginx-version/html and start the NGINX server using the following command from a command line interface opened at the location nginx-version. start nginx 5. Upon successful execution, you should access the angular-demo web application from browser. 5 P a g e

Figure 2-Welcome Page 1.4. Project Structure This subsection details the structure of the project. When opened in WebStorm, the project has the following structure: Figure 3-Project Structure Details 6 P a g e

2. Project Conceptual Architecture The conceptual architecture of the system is presented below. The Angular application communicates with the Spring application through JSON (JavaScript Object Notation) objects. JSON is a syntax which can be used to store and exchange data. The controllers execute complex operations and communicate with the back-end. The views are html files and css files that use services to display information or to send information. The model classes are written in JavaScript and are used by the services and by the views. Figure 4-Project Conceptual Architecture Table 1-Project Component Description Architectural Dimension Files Description Model Model classes located in model folder. Contains the model classes which are used for the communication between views and controllers. The classes are View Controller Files ending in.html and.css. Files located in services folder and files ending in.component.ts. written in JavaScript. Contains the.html and.css pages of the application. The JavaScript objects populate the.html files. The services execute complex operations, communicate with the backend spring-demo application through JSON objects and use model classes for displaying the information in the view files. 7 P a g e

3. Project Functionality The flow of the operations which are required for the retrieval of all the users from the angulardemo application using the spring-demo application is presented in the following sequence diagram. The processing steps are detailed next: Figure 5-Sequence Diagram for Retrieving All Users 1. The user clicks on the Users button from the top-left corner of the application. Good to know a) What is the purpose of the <app-root> tag? The <app-root> tag is written in index.html and this is how Angular knows how to determine the component which corresponds to the tag, in this case the component AppComponent. Figure 6-Snippet from index.html 2. The method which is specified by the attribute (click) (line 3) in the file header.component.html is called. 8 P a g e

Figure 7-Call the method getusers() Good to know a) What are the three main parts of an Angular component? The three main parts of an Angular component are the selector, the template and the style. The selector is a tag that is written in an html file and this is how the application knows how to interpret that an Angular component should be used. The template is an html file in which the component displays the information and the style describes how the content from the html file should be displayed. Figure 8-Snippet from header.component.ts 3. Navigate to users (line 18) which is associated with the UsersComponent. In the file app.module.ts the path users corresponds to UsersComponent. Figure 9-Code Snippet from HeaderComponent Good to know a) How to connect the paths and the components? The RouterModule from app.module.ts is used for connecting the paths and the components. Each route has a path and a component. The path describes how the component can be accessed in the application. 9 P a g e

Figure 10-Snippet from app.module.ts 4. Call the getusers() (lines 15-17) method from UserService. Figure 11-Code Snippet from UserService 5. The following HTTP request is sent to the spring-demo application: http://localhost:8080/spring-demo/user/all Good to know a) How to create an HTTP request in Angular? In Angular an HTTP request can be created using the class HttpClient from the library @angular/common/http. 10 P a g e

Figure 12-Snippet from user.service.ts 6. The spring-demo application returns the HTTP response and at this stage the objects are in JSON format. 7. The objects in JSON format populate an array of objects of type User: User[]. 8. The users object from UsersComponent is populated with User[] data (line 22). Figure 13-Code Snippet from UsersComponent 9. The users data is used for populating the table from users.component.html. Good to know a) What is Angular Material? Angular Material is used for creating high-quality UI components using TypeScript and Angular. Figure 14-Snippet from app.module.ts 10. The users table is displayed in the angular-demo application. 11 P a g e

4. Testing the Project 1. Insert several users in the table user from the spring-demo database. 2. Run the spring-demo application as in the previous Hands-On. 3. Run the angular-demo application as explained in the first section of this Hands-On. 4. Access the following link in the browser: Alternative 1 (WebStorm): http://localhost:4200/ Alternative 2 (NGINX): http://localhost:80/ 5. Click on the Users button located in the top-left corner of the web page. You should be able to visualize the users that populate the user table from the spring-demo database. 5. Reinforcement Learning Answer the following questions: Figure 15-Display All Users What are the Angular components? How is dependency injection realized in Angular? In which file are organized the imports and the declarations? Explain the MVC architecture of the Angular framework. What is Angular Material used for? 6. References [1] https://angular.io/ [2] https://medium.com/@mail.bahurudeen/simple-crud-functionality-using-angular-5-withbootstrap-4-f7baac0d2000 [3] https://inkoniq.com/blog/googles-baby-angularjs-is-now-the-big-daddy-of-javascriptframeworks/ [4] https://go.tiny.cloud/blog/angular-5-tutorial-step-step-guide-first-angular-5-app/ [5] https://material.angular.io/ 12 P a g e