Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
Angular 2 native desktop app (without Electron) example

Angular website (www.angular.io) claims Angular can be used for "For web, mobile web, native mobile and native desktop." I'd like to find out more about native desktop capabilities but can't find anything on angular.io site. Can someone point me to some documentation or examples?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

This is confusing, but there is no way to create a native desktop app with Angular2 only. Maybe this is the plan for the future, but it is not possible yet. But Angular2 is working quite well with Electron! I wrote a blog about it, unfortunately it is in German only :( But maybe you can simply translate it with the Google Translator: https://medium.com/@baerree/ich-packe-meine-koffer-angular-cli-electron-ii-28644342b956

Basically, you need to run the steps described here: http://www.blog.bdauria.com/?p=806

After building the electron skeleton around your app and did the Angular2 configuration steps described in the link, there is one thing to do:

The electron scope is missing inside your Angular2 scope. That means, if you want to access it you need to pipe electron inside Angular2. This is done by adding the following to your index.html (beware, this is not a clean solution):

 <script>
  var electron = require('electron');
 </script>

after you did this, you need to tell typescript, that there is a electron variable now, by adding this to your typescript.d.ts:

declare var electron: any;

you can access electron inside Angular2 now by calling:

var app = electron.remote.app;

with the app variable you have full access to electron and your electron.js file. E.g. you could do things like that:

this.title = app.getAppPath();

I hope this helped at least a bit :)

Cheers

about 4 years ago · Santiago Trujillo Relatório

0

Well you have to have a wrapper of some sort. There is not way that angular 2 by itself can create desktop applications. Angular is purely web technology and so works with the browser. Frameworks like electron create a browser wrapper to trick a user into thinking that the application is not a browser like chrome.

Having said that to completely answer your question, you can create an angular 2 application without electron using asp core and the Universal Windows Platform Which allows you to develop in javascript,html and css, which is exactly what angular is. However you are then locked into .net and only windows desktops applications. Which , if you are only developing for windows then this is a much better solution then electron IMHO.

Also note you will probably be writing some C# configuration.

There are also alternatives to electron which pretty much do the same thing ( browser wrapper)

http://appjs.com/

https://nwjs.io/

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda