Reputation: 11
Trying to get my angular app running in NW.js but having some issues.
On a fresh project using the latest angular version 16, and correct versions of node and npm installed. Using npm i can install the nw package, and configure my package.json like this:
{
"name": "nw-test-proj",
"version": "0.0.0",
"main": "src/index.html",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"nwstart": "nw ."
},
"private": true,
"dependencies": {
"@angular/animations": "^16.1.0",
"@angular/common": "^16.1.0",
"@angular/compiler": "^16.1.0",
"@angular/core": "^16.1.0",
"@angular/forms": "^16.1.0",
"@angular/platform-browser": "^16.1.0",
"@angular/platform-browser-dynamic": "^16.1.0",
"@angular/router": "^16.1.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^16.1.0",
"@angular/cli": "^15.2.11",
"@angular/compiler-cli": "^16.1.0",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.6.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"nw": "^0.87.0-sdk",
"typescript": "~5.1.3"
}
}
But when i run my app with this index.html body:
<body>
<p>hello</p>
<app-root></app-root>
</body>
A window will pop up but i can only see the p-tag and "hello" in the window, and nothing inside my app-root
Ive spent a few days looking online for any resources and double checking documentation but cant find anything. Ive followed a few guide for Angular and NW.js and how to setup, and its all very basic and easy to start up an app in an NW.js window, but for some reason my src files arent loaded by the window and/or i cant see my actual application beyond app-root.
Ive tried using the source files, both sdk and normal but those dont work either.
Upvotes: 1
Views: 56
Reputation: 349
This boilerplate is for Angular 17 and NW.js:
You should start there and move your files over.
Upvotes: 0