-
-
Notifications
You must be signed in to change notification settings - Fork 172
Integrate TypeScript and Angular 2 #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Some info #19 (comment) |
I got as far as getting an Angular 4 app running within electron-webpack, but I can't get the angular2-template-loader working. I used the Quick Start from this project's README then added the required angular libs with Yarn...
I added Typescript support as per the docs: https://webpack.electron.build/add-ons In
There's an extra few lines before the bootstrap to add the You have to change the selector in
This allowed my to get a basic Angular 4 app up and running in electron-webpack - as long as I use inline templates. When I tried to add templates using |
I think I've got it working by adding the following
|
@darrenmothersele thanks! Thanks for article, I will try to simplify and explicitly support angular next week. |
@darrenmothersele thank you! That guide was very helpful. Have you had any luck with packaging? I was able to get this running in a development environment however when I package with electron builder I get tons of template parse errors such as "Can't bind to 'routerLink' since it isn't a known property of 'li'".
Edit: Sorry, I just realized that the example repo you listed runs fine when compiled. My issue is specific to my app and I'll need to keep digging. Edit2: I've further narrowed down the issue I'm having. If I simply change the template file to
This is strange because the 'ngIf' in the template is capitalized correctly but 'ngif' in the error is not. |
That is strange. I've been looking into an alternative approach using the webpack config generated by Angular CLI. It would be good to be able to take advantage of some of the improvements offered by CLI 1.5, and be able to continue to make use of CLI functionality for the project. Ideally, I would be able to take the Angular CLI project, and add I'll post a follow up to that Medium article once we've worked out how we're going to approach this. |
@darrenmothersele any luck with that setup? |
@ocombe I'm still working on this. To make things even more interesting we're now also using Ionic, with Angular CLI and Electron! |
Any update? |
@abruneau After modifying my module.exports = {
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: [
{
loader: "ts-loader",
},
{
loader: "angular2-template-loader"
}
]
},
{
test: /\.(html)$/,
use: {
loader: "html-loader",
options: {
// angular 2 templates break if these are omitted
removeAttributeQuotes: false,
keepClosingSlash: true,
caseSensitive: true,
conservativeCollapse: true,
}
}
}
]
}
}; Update: Its fully working for me! :) |
Thanks @PLehmColCom |
Hallo,
is there some boilerplate project or a tutorial how one could integrate TypeScript and Angular 2 with electron-webpack? I'm new to Webpack and Electron and can't figure out what I have to do to support this.
Thanks,
Steven
The text was updated successfully, but these errors were encountered: