Issues setting up and running an Angular 4 application without node.js - javascript

Currently, my web app consists of java with a html/css/js front end. I am trying to convert my application over to angular 4 while still using java instead of node.js/npm. This is my first time building an Angular 4 app and I am having some issues :( "I've created tutorial/demo apps before but this is my first time converting an entire web app to Angular 4."
I know that using node.js and npm is seen as the easy solution when working with Angular 4, but I need to use java instead of node.js/npm.
The issue I'm having:
I entered some sample code for Angular 4 into my application and when I attempt to build it using the "ng-install", I get a error that says "node_modules appears empty, you may need to run npm install".
I do not want to use node.js or npm in my project. Instead I want to keep using Java.
Does anyone have any examples or advice? All help is appreciated.

I think you mix up a couple of things: Java is the language which you use to build your backend. Do this, that's fine. JavaScript is language which is used for your frontend. Your problem is building the project. NPM is a package manager for JavaScript libraries. Even if you use NPM, it doesn't mean that you cannot use Java. Those are two different things.
Usually you would use Maven (or Gradle) to build your Java project and NPM or Bower to build your frontend. If you don't want to use NPM (because it needs NodeJS), you can use things like https://www.webjars.org. However, I would recommend to use NPM.

Related

npm build pure html/css/js frontend website

Is it possible to build a website purely made from HTML/CSS/JS with npm?
I want to use some npm modules in my 1 javascript file, but I don't know which built tool I need to use and how in order to end with just 1 JS file.
Thanks for the help!

Create an electron JS desktop app with python and react js

I want to create a desktop app with Electron JS and form front end I can use React JS as I'm familiar with it.
I have a good grasp of Python I checked over the internet but they all wanted me to create an API and run it on local I can do that and connect to react electron app but for distribution, I need the user to install Python as well.
I know I can go for node js as a backend but I have a lot of work ready in Python like backend logic and the app will run on desktop only no need to connect to Internet for that.
I need to know if I need user to install python as well. I don't want that.
I think this is exactly what you're looking for, it's a reusable Electron template that uses a React front-end with Redux & Redux Toolkit, and is integrated with Python/Flask for microservices. Packaging functions with build scripts are available for Windows and macOS.
You can just copy the parts you need or clone the template and use it.
https://github.com/iPzard/electron-react-python-template
If you don't want the user to have to install Python then you need to use something to package it together. Check out Pyinstaller, once you've created an exe it can be distributed and doesn't require the user to install Python
https://www.pyinstaller.org/

Add NodeJS backend code to an Angular-seed based project

I recently abandoned the awesome LAMP solution for Node/AngularJS and I have some serious (and noob) difficulties to begin.
I took an existing AngularJS project based on Angular Seed and I didn't figure out how can I add some backend javascript code.
In online tutorials, I always find an app.js file, in which there is some "requires" and where I can add an extra server code. To launch this kind of project I have to node app.js
In my Angular-seed based project, there is only a package.json that contains script commands.
Also, I noticed that to launch it, I have to npm start.
Where can I put my NodeJS code in this project ?
Thanks in advance !
Usually you will have two differents projects. The backend (Nodejs) and the frontend (Angular). You can expose your backend logic using a public API that your frontend will use. For example you can expose a REST API using nodejs with help of express. I recommend you to take a look at swagger that can help you to define your api.
After that using your angular app you can send different requests to that API and consume the info that receive from it.
To sum up you will have two different projects. Hope this helps

Build for js environment without npm?

We are currently building our frontend js codebase (angularjs) using nodejs with grunt, which seems to be a popular setup, but we are not happy with this solution. Does anyone have suggestions for a build setup for e.g. linting, minimizing our js, running less, etc (in addition to some custom steps for angular in general and for our application specifically) without using nodejs at all?
I would leave it at that to avoid starting a flamewar, but here are, for context, some of the shortcomings of the current setup in our view:
grunt does not have even the basic functionality of a 1970s build system, like automatically re-building only files that have been modified based on file modification time
npm is causing constant headaches running on our build servers at every build
If grunt does not have even the basic functionality of a 1970s build system, why won't you use a 1970s build system then?
Just use make if that's what you're happy with. It still works fine. There's no reason not to use it if it you're satisfied with how it works.

Meteor with both blaze (web) and angular (mobile)

I'd like to create a mobile/cordova version of my Meteor web application. The web version uses blaze -- which I'd like to stick with -- and for the mobile app version Ionic seems like an excellent choice for UX. Ionic is more-or-less coupled with Angular which creates a templating conflict at runtime:
error: conflict: two packages included in the app (angular-templates and templating) are both trying to handle *.html
error: conflict: two packages included in the app (pbastowski:angular-babel and ecmascript) are both trying to handle *.js
Other than, say, forking my project to create a separate non-blaze repo, are there any ways to configure meteor to only use angular/babel if the app is running with cordova?
After a good bit of digging and research, this is what I've come to conclude:
It seems the typical solution to this kind of problem in Meteor is to disaggregate your application into a collection of packages.
With packages there is a greater control over how and where dependencies are loaded. So in this particular case, there'd be at least two packages -- one which contains browser specific code and another which contains Cordova specific code.
Here's one simple example of an application broken into packages supporting a mobile and web-based experiences: https://github.com/Compy/meteor-mobile-desktop
And here's a pretty comprehensive tutorial on breaking an existing application into a package based architecture: http://experimentsinmeteor.com/package-based-architecture/

Categories

Resources