Coder Social home page Coder Social logo

rajeshsuramalla / angularwithdotnetcoreelectronnet Goto Github PK

View Code? Open in Web Editor NEW
27.0 1.0 9.0 642 KB

Angular SPA with Dotnet Core and ElectronNet API

JavaScript 7.39% TypeScript 42.48% CSS 2.16% HTML 21.42% C# 26.55%
dotnet electronnet-api electronnet angular typescript dotnet-core

angularwithdotnetcoreelectronnet's Introduction

AngularWithDotNetCoreElectronNET

Angular SPA with Dotnet Core and ElectronNet API

  1. Open VS 2017 with Administrator mode

  2. Create Asp.Net core Web Application with Angular template

  3. Install the ElectronNET.CLI using following command "dotnet tool install ElectronNET.CLI -g"

  4. Goto project folder and open cmd

  5. Execute the following command "electronize init", it will create electron-manifest.json file in project folder

  6. Right click on dependencies, goto Nuget package manager and install ElectronNET.API

  7. Add ElectronBootstrap() method in Startup.cs

         public async void ElectronBootstrap()
         {
         BrowserWindowOptions options = new BrowserWindowOptions
         {
             Show = false
         };
     BrowserWindow mainWindow = await Electron.WindowManager.CreateWindowAsync();
         mainWindow.OnReadyToShow += () =>
         {
             mainWindow.Show();
         };
         mainWindow.SetTitle("App Name here");
    
         MenuItem[] menu = new MenuItem[]
         {
             new MenuItem
             {
                 Label = "File",
                 Submenu=new MenuItem[]
                 {
                     new MenuItem
                     {
                         Label ="Exit",
                         Click =()=>{Electron.App.Exit();}
                     }
                 }
             },
             new MenuItem
             {
                 Label = "Info",
                 Click = async ()=>
                 {
                     await Electron.Dialog.ShowMessageBoxAsync("Welcome to App");
                 }
             }
         };
    
         Electron.Menu.SetApplicationMenu(menu);
     }
    
  8. Call that method from Configure() in Startup.cs

      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
     {
         ElectronBootstrap();
     }
    
  9. Add UseElectron(args) in Program.cs

     public static IWebHostBuilder CreateWebHostBuilder(string[] args)
     {
         return WebHost.CreateDefaultBuilder(args)
             .UseStartup<Startup>()
             .UseElectron(args);
     }
    
  10. Build the project

  11. Goto project folder, open cmd and execute the following command "electronize start", it will open the desktop application. First time it will take time.

  12. Production build for windows: electronize build /target win

Prerequisites

  1. Dotnet core SDK 3.1
  2. Node js
  3. Angular
  4. ElectronNET.CLI 9.31.2

angularwithdotnetcoreelectronnet's People

Contributors

azhe403 avatar rajeshs-logicmatter avatar rajeshsuramalla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

angularwithdotnetcoreelectronnet's Issues

Should the UI refresh when Angular HTML files are updated?

Thanks for building this starter project - I'm looking to use it as a launching point for a new project and it looks like it's going to get me up and running very quickly. Only issue I can see is that it says on the home page that "your client-side resources are dynamically built on demand and the page refreshes when you modify any file" - however I tested changing the "Hello, world!" heading in home.component.html and saved, expecting the UI to update itself, and it didn't. Restarting my app for every UI change is going to be somewhat of a nuisance to my development process so I'd really like to get automatic recompile working before I get started - any ideas?

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.