GithubHelp home page GithubHelp logo

grizlizli / ng-goes-native Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 6.46 MB

Complete setup for developing multi platform solutions with Angular, NativeScript and Electron.JS

TypeScript 36.39% CSS 4.53% HTML 6.87% JavaScript 52.21%

ng-goes-native's Introduction

ng-goes-native

One Framework To Rule Them All

Complete setup for developing multi platform solutions with Angular, NativeScript and Electron.JS

One Framework To Rule Them All

Motivation

  • Business logic is platform independant
  • Using familiar technology
  • Having the native experience

Setup

Generating The Shared Angular & NativeScript project

This project was generated with Angular CLI version 6.1.0 with NativeScript schematics included. Shared flag transforms the project to shared Angular & NativeScript project.

ng new --collection=@nativescript/schematics --style=scss --shared <appname>

More about Angular Schematics can be found on the Angular Docs page.

More on using the NativeScript Angular Schematics.

Adding the Electron.JS Dev Dependency

Electron.JS is an Open Source Framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application.

npm install electron --save-dev

Also, the electron-packager is added as a Dev Dependency as we are going to use it as a Application Distribution tool.

npm install electron-packager --save-dev

And in order to deploy our Electron App, we are going to use this command:

electron-packager <sourcedir> <appname> --platform=<platform> --arch=<arch> [optional flags...]

Adding a service worker to the project

To set up the Angular service worker in your project, use the CLI command ng add @angular/pwa. It takes care of configuring your app to use service workers by adding the service-worker package along with setting up the necessary support files.

ng add @angular/pwa

Also, for testing our PWA app, we'll need some HTTP Server.

npm install lite-server --save-dev

After that, we'll need to build our app.

ng build --prod

And then we can start our local HTTP server.

lite-server --baseDir=dist/<appname>

ng-goes-native's People

Contributors

grizlizli avatar

Stargazers

Filip Stefanović avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.