angular2AppName is not defined
See original GitHub issueHi,
I juste move to Jhipster 5.1 and a weird issue.
On a fresh Jhipster install, i install jhipster-prime and get the text below
TL;DR
angular2AppName is not defined
How can I get rid of this ?
PS : on a fresh jhipster installation i made
npm install -g generator-jhipster-primeng
npm update -g generator-jhipster-primeng
But when i try
yo jhipster-primeng
I got the error.
Any help would be appreciate
Details
C:\Users\giova\Work\Projects\demo-prime-ng>yo jhipster-primeng
βββββββ βββββββ βββ ββββ ββββ ββββββββ ββββ βββ βββββββ
ββββββββ ββββββββ βββ βββββ βββββ ββββββββ βββββ βββ ββββββββ
ββββββββ ββββββββ βββ βββββββββββ ββββββ ββββββ βββ βββ ββββ
βββββββ ββββββββ βββ βββββββββββ ββββββ ββββββββββ βββ βββ
βββ βββ βββ βββ βββ βββ βββ ββββββββ βββ ββββββ βββββββββ
βββ βββ βββ βββ βββ βββ ββββββββ βββ βββββ βββββββ
Welcome to the JHipster primeng generator! v2.0.55
? Do you want to install PrimeNG? Yes
? Which theme would you like to use? Rocket
? What is your preferred component selection criteria Component Groups
? Which component groups you would like to use? inputs, buttons, data, panel, overlay, fileupload, menu, charts, messages, multimedia, dragdrop, misc
Add the resources in the head section of index.html file- <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css"/>
<script src="https://www.google.com/recaptcha/api.js?render=explicit&onload=initRecaptcha" async defer></script>
<script src="https://cdn.quilljs.com/1.0.0/quill.js"></script>
<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyA6Ar0UymhiklJBzEPLKKn2QHwbjdz3XV0" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.js"></script>
The PrimeNG resources were updated successfully using JHipster API!
events.js:183
throw er; // Unhandled 'error' event
^
ReferenceError: C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\generators\app\templates\src\main\webapp\app\primeng\primeng.module.ts:4
2| import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3|
>> 4| import { <%= angular2AppName %>ButtonDemoModule } from './buttons/button/buttondemo.module';
5| import { <%= angular2AppName %>SplitbuttonDemoModule } from './buttons/splitbutton/splitbuttondemo.module';
6|
7| import { <%= angular2AppName %>DialogDemoModule } from './overlay/dialog/dialogdemo.module';
angular2AppName is not defined
at eval (eval at compile (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:618:12), <anonymous>:11:26)
at returnedFn (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:653:17)
at Object.exports.render (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\ejs\lib\ejs.js:416:37)
at process (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:12:18)
at applyProcessingFunc (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:13:16)
at EditionInterface.exports._copySingle (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:63:16)
at files.forEach.file (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:50:10)
at Array.forEach (<anonymous>)
at EditionInterface.exports.copy (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy.js:49:9)
at EditionInterface.module.exports [as copyTpl] (C:\Users\giova\AppData\Roaming\npm\node_modules\generator-jhipster-primeng\node_modules\yeoman-generator\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:10:8)
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
angular not defined, cannot get angular side of app running
To fix it, try this instead: var app = angular.module('app', ['ngRoute']); app.config(function($routeProvider, $locationProvider){ $locationProvider.
Read more >How to fix Name Not Defined Error in Python - YouTube
This video will explain how to solve the 'something' is not defined error in Python.
Read more >NameError: name 'requests' is not defined - YouTube
NameError: name 'requests' is not defined.
Read more >name 'x' is not defined Python NameError - YouTube
The first video in the series dedicated to debugging various python errors. This video covers the NameError within python.
Read more >JavaScript lodash lowerFirst Examples
lowerFirst(Type.name)} called with something that's not a subclass of Sequelize. ... options.hooks === undefined ? false : Boolean(options.hooks); options.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am newbie in both angular and jhipster so I am not sure about these steps, but the below steps solved many of my issues
In generator-jhipster-primeng\generators\app\index.js Below line this.angularAppName = this.getAngularAppName(); added this.angular2AppName = this.getAngularXAppName();
In the *.route.ts files under generator-jhipster-primeng\generators\app\templates\src\main\webapp\app\primeng the path to the UserRouteAccessService was wrong. To correct this I searched and replaced the import statements as below
import { UserRouteAccessService } from ββ¦/β¦/β¦/shared/sharedβ; with import { UserRouteAccessService } from ββ¦/β¦/β¦/core/auth/user-route-access-serviceβ;
In templates for services the below lines was causing an error .map((response) =>
This was replaced with .map(response =>
Hi,
Iβve apply the fix you suggest.
In node_modules\generator-jhipster-primeng\generators\app\index.js, i add this line :
this.angular2AppName = this.getAngularAppName()
Installation successfull! But then, i tried to start the application with yarn start and got a LOT of errors.
Please, could you provide any help fixing this ?
Thanks
(this is just an extract of ERRORS and WARNING)