Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Ionic Framework for Web App Development?

Is it possible to use ionic frameowork for regular Web Applications rather than wrapping it in Cordova?

like image 801
xivo Avatar asked Apr 04 '14 18:04

xivo


People also ask

Can we develop web app using Ionic?

Depending on the complexity of the app it is absolutely possible to use the Ionic Framework for regular web applications! When you create your app there is a /www folder that contains all your HTML, JS, and CSS. That's the front end for your web app.

Is Ionic good for app development?

As it utilizes a combination of Apache Cordova and Angular, Ionic for many developers, is the first choice for app development. It provides tools such as HTML5, CSS, SaaS, etc to develop top-notch hybrid mobile apps to be run on Windows, Android, and iOS.


2 Answers

This is possible if you include the components of www/lib/ - This folder contains the core of ionic(the ionic framework + angularjs) and you can proceed from there.

However it's important to note that ionic was built on top of angularjs, specifically with mobile in mind. To get better results for web app development, you should consider using core angularjs(for functionality) and bootstrap3 (for UI).

like image 191
Orane Avatar answered Sep 29 '22 10:09

Orane


V2

Ionic now supports PWA(web apps) and support for desktop is coming too soon

Ionic build browser

V1

Ionic can be used for regular web development. If all you need is web dev stop here. But if you want your app & web to serve from the same codebase read further

Step 1

Create a copy of index.html inside merges/browser/ (merges is at the root level i.e myApp) include

<script>     var is_browser = true </script> 

&

<body ng-app="myApp" class="platform-website"> 

Step 2

Remove unnecessary js files like cordova.js from index.html

Step 3

add in app.js

var is_app = (typeof is_browser === 'undefined' && !ionic.Platform.is('browser')               && ionic.Platform.isWebView()); 

Now use css hide/show or angular hide/show using these

like image 39
aWebDeveloper Avatar answered Sep 29 '22 12:09

aWebDeveloper