Top Banner
Introduction to Ionic Framework fundamentals
19

Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Mar 14, 2023

Download

Documents

Khang Minh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Introduction to Ionic Framework fundamentals

Page 2: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Native apps Hybrid apps

Page 3: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Native apps

• Platform specific:

• iOS - Objective C, Swift

• Android - Java, Kotlin, C++

• Wide variety of uses cases

• Fluid User experiences

• Expensive to build, time consuming

Page 4: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Hybrid Apps

• Cross-platform:

• Written in JavaScript using Frameworks like Ionic, React Native

• Single code base running on different platforms

• Native capabilities using plugins

• Good enough performances

• Easier and faster to build

Page 5: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Native Apps Hybrid apps

Crossplatform No Yes

Pace of Development Slow Fast

Ease of development A bit difficult Easier

Native Capabilities Yes Yes

Performance Pretty fast Fast enough

Written in iOS: Swift, Objective-CAndroid: Java, Kotlin

JavaScript using frameworks like Ionic, React native etc.

Page 6: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur
Page 7: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

https://cordova.apache.org

Page 8: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Single Page Applications

Page 9: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Client Server

Initial Request

HTML Page

Another Request

Another HTML Page

Traditional Webpages

Page 10: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Client Server

Initial Request

HTML Page

Another Request

JSON Data

Single Page Webpages

Page 11: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

A popular Open-Source project

MVC architecture

Page 12: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Module

Component

Services

HTML PageBinding

JSON

Angular Architecture

Metadata

Page 13: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Angular Binding

• Interpolation

Component View

name = “foo”;

<span>{{name}}</span>

=<span>foo</span>

Page 14: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

Angular Binding

• Two way Binding

Component

View

name;

<input type=“text” [(ngModel)]=“name”>

<span>{{name}}</span>

Page 15: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

<html>

<head> <title>Title</title>

</head>

<body> <h1>This is heading</h1> <ul> <li>One</li> <li>Two</li>

</ul> </body>

Page 16: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

<html>

<head> <title>Title</title>

</head>

<body> <h1>This is heading</h1> <ul> <li>One</li> <li>Two</li>

</ul> </body>

document

<html>Root Element

<head> <body>

<title>

Title

<h1> <ul>

This is …

<li><li>

One Two

DOM

Page 17: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

<html>

<head> <title>Title</title>

</head>

<body> <h1>This is heading</h1> <ul> <li *ngFor = “let model of models”> {{model.title}}

</li> </ul>

</body>

document

<html>Root Element

<head> <body>

<title>

Title

<h1> <ul>

This is …

<li><li>

One Two

*ngFor Directivemodels = [ {title: “One”}, {title: “Two”}

]

Page 18: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

<html>

<head> <title>Title</title>

</head>

<body> <h1>This is heading</h1> <ul *ngIf = “showList”> <li *ngFor = “let model of models”> {{model.title}}

</li> </ul>

</body>

document

<html>Root Element

<head> <body>

<title>

Title

<h1> <ul>

This is …

<li><li>

One Two

*ngIf Directive - True Conditionmodels = [ {title: “One”}, {title: “Two”}

];

showList = true;

Page 19: Introduction to Ionic Framework fundamentals - CSE - IIT Kanpur

<html>

<head> <title>Title</title>

</head>

<body> <h1>This is heading</h1> <ul *ngIf = “showList”> <li *ngFor = “let model of models”> {{model.title}}

</li> </ul>

</body>

document

<html>Root Element

<head> <body>

<title>

Title

<h1>

This is …

*ngIf Directive - False condition

models = [ {title: “One”}, {title: “Two”}

];

showList = false;