Open MarinAngelo opened 7 years ago
3.x.x versions of the generator use 0.x.x versions of generator-ng-component, as you can see here.
4.x.x versions of the generator bundle front-end code using Webpack. There is nothing stopping you from using factories and Angular 1.5 components in either major version.
Hi, thanks for your reply! Does this mean that in my app version 3.7.5 I can use "yo angular-fullstack:service myService" as usual and it should work? In the console I get: ReferenceError: require is not defined
If you're trying to run yo angular-fullstack
commands for a project, your generator-angular-fullstack
major version that's installed globally needs to match the generator-angular-fullstack
major version that you scaffolded with. So if you scaffolded with 3.7.5, you should have generator-angular-fullstack@^3.7.5
installed globally.
OK, then I have the wrong verstion ( 3.8.5) how can I change the version? I have uninstalled the current generator and then installed again with command "npm install -g generator-angular-fullstack@3.7.5" but it still installed version 3.8.5.
The latest version of 3.x.x is 3.8.0, so I think you're looking at the wrong version. Try npm list -g --depth=0
ok, I have the following entry: /home/marinus/.nvm/versions/node/v6.5.0/lib ├── bower@1.7.9 ├── generator-angular-fullstack@3.7.5 ├── gulp-cli@1.2.2 ├── npm@3.10.3 └── yo@1.8.5 But when I run a sub generator I get still uncompatible code. Do I have tu use the subgenerators also with "@3.7.5" at the end (yo angular-fullstack:route@3.7.5 myroute )?
Do me a favor and check npm list -g generator-angular-fullstack --depth=1
. This will show which version of generator-ng-component you have installed. Also, what is under generatorVersion
in your .yo-rc.json
file?
/home/marinus/.nvm/versions/node/v6.5.0/lib └── generator-angular-fullstack@3.7.5
.yo-rc.json:
"generator-angular-fullstack": { "generatorVersion": "3.7.5",
npm list -g generator-angular-fullstack --depth=1
should print out all the top-level dependencies of your installed generator-angular-fullstack
. Are you sure you put it in correctly?
yes, I'm sure, just made it again and have same output.
Strange. Maybe try a rm -rf /home/marinus/.nvm/versions/node/v6.5.0/lib/generator-angular-fullstack
and then re-install?
Hi, I have utilized your recipe, it does not change anything, I've got still the same output after running "npm list -g generator-angular-fullstack --depth=1". And when adding a new route I still get the wrong code. E.g. *.component.js*** 'use strict'; const angular = require('angular');
const uiRouter = require('angular-ui-router');
import routes from './portrait.routes';
export class PortraitComponent { /@ngInject/ constructor() { this.message = 'Hello'; } }
export default angular.module('svsAppApp.portrait', [uiRouter]) .config(routes) .component('portrait', { templateUrl: 'app/portrait/portrait.html', controller: PortraitComponent, controllerAs: 'portraitCtrl' }) .name;
instead of: ***.controller.js****** 'use strict'; (function(){
class MreleaseComponent { constructor() { this.message = 'Hello'; } }
angular.module('svsAppApp') .component('mrelease', { templateUrl: 'app/mrelease/mrelease.html', controller: MreleaseComponent });
})();
Hi there
I have some problems with adding factories and components to my project. Are the new items that are genereted by yo compatible to older verseions? To me it seams not to be so and I do not understand the code at all, things like (export and require). How can a add items that fit into the syntax of version 3.7.5?
Kind Regards
Marinus