johannesjo / generator-modular-angular

A truly modular yeoman generator for AngularJS all device apps.
MIT License
21 stars 6 forks source link

Error with route generator #13

Closed 34r7h closed 9 years ago

34r7h commented 9 years ago

Really stoked at the sophistication in this generator. thanks for taking the time to think it through.

running into a problem with the route generator. Task 'inject' is not in your gulpfile gulpfile.js is mainly empty and i've been battling my stack for a couple days but please let me know if this is a known situation.

Would you like to create a service or factory for the route? No create app/scripts/_routes/test/test-c.html create app/scripts/_routes/test/_test-c.scss create app/scripts/_routes/test/test-c.js create app/scripts/_routes/test/test-c.spec.js [03:32:01] Using gulpfile ~/dev/clients/alugha/gulpfile.js [03:32:01] Task 'inject' is not in your gulpfile [03:32:01] Please check the documentation for proper gulpfile formatting

johannesjo commented 9 years ago

Thank you very much for reporting! I'm also really happy to hear that you find the generator useful. If you miss anything else, let me know.

Regarding the issue: There was problem as I renamed the gulp task and forgot to change it in the call after the generators finished. This slipped through as all tests run with the --skipInject flag as gulp is not available during unit testing the generator, but I'm testing this on the integration tests on travis now, so hopefully that won't happen again.

Just update to the latest version and it should work again.

34r7h commented 9 years ago

most excellent. npm update generator-moda -g works.

delighted, thank you!

34r7h commented 9 years ago

Hi again, the route generator works without errors (creates files) however, a new route is not injected into routes.js.

Sorry to reopen old wounds hehe.. thought this could be related to the original issue but let me know if it's really a new one.

johannesjo commented 9 years ago

Thanks again for reporting. This is most helpful! I will try to look into it on Sunday. Sorry for the bugs. Testing this is a little tiresome as it takes a lot of time, even if automated...

johannesjo commented 9 years ago

Could you test if it works for you with the newest patch?

34r7h commented 9 years ago

Indeed, the patch is working and a new route is injected. Thanks for your quick attention. Enjoying your workflow very much!

clabnet commented 9 years ago

Using Windows 10, the creation of route fails: the templateUrl use backslash () and not use slash (/). Below code : search route = incorrect; configure = correct.

Thank's for your work.

$stateProvider .state('search', { url: '/search', controller: 'SearchCtrl', templateUrl: 'scripts\routes\search\search.html' }) .state('configure', { url: '/configure', controller: 'ConfigureCtrl', templateUrl: 'scripts/routes/configure/configure.html' })

johannesjo commented 9 years ago

@clabnet Thanks for reporting. Is there a reason why you would want to use backslashes instead of slashes in this context? And what does the output look like? Is there an error message in the console is there some output?

clabnet commented 9 years ago

The result is a fatal error. The backlashes are unescaped and the final result is a concatenated string as is: ... state('search', { url: '/search', controller: 'SearchCtrl', templateUrl: 'scriptsroutessearchsearch.html' ...

johannesjo commented 9 years ago

Sorry @clabnet I would need a little more detailed description of what you were doing exactly. Which commands are you running, what is the exact output and where is the output given.

clabnet commented 9 years ago

I retry to explain me.

I use your generator-moda version updated at now on Windows 10 eng pro x64.

Running :

the result of file "routes.js" is:

angular.module('app') .config(function ($stateProvider, $urlRouterProvider) { 'use strict'; $urlRouterProvider.otherwise('/'); $stateProvider .state('search', { url: '/search', controller: 'SearchCtrl', templateUrl: 'scriptsroutessearchsearch.html' }) /* STATES-NEEDLE - DO NOT REMOVE THIS */; });

How you can see, the templateUrl string is a bad concatenated string, the slashes are not present. Result is: route not found.

That's all, bye.

johannesjo commented 9 years ago

Thank you very much. I'll look into it!

Claudio Barca notifications@github.com schrieb am Do., 15. Okt. 2015 22:19:

I retry to explain me.

I use your generator-moda version updated at now on Windows 10 eng pro x64.

Running :

  • yo moda:r search

the result of file "routes.js" is:

angular.module('app') .config(function ($stateProvider, $urlRouterProvider) { 'use strict'; $urlRouterProvider.otherwise('/'); $stateProvider .state('search', {

url: '/search', controller: 'SearchCtrl', templateUrl: 'scriptsroutessearchsearch.html'

}) /* STATES-NEEDLE - DO NOT REMOVE THIS */; });

How you can see, the templateUrl string is a bad concatenated string, the slashes are not present. Result is: route not found.

That's all, bye.

— Reply to this email directly or view it on GitHub https://github.com/johannesjo/generator-modular-angular/issues/13#issuecomment-148509218 .

johannesjo commented 9 years ago

@clabnet sorry to bother you again. I'm running linux, that is, why it is hard for me to debug. I have to ask, if the route generator is the only one which doesn't work? Does the same happen, if you create a directive with a template?

johannesjo commented 9 years ago

@clabnet ok I think i figured it out. The problem is that path uses windows directory seperators on windows. I made a quick fix. Would be really nice if you could check it out!

clabnet commented 9 years ago

Sorry, but the last fix don't work, but the road can be correct.

Now, at creation of route or directive, the result is that: templateUrl: 'scripts/common\dcc-login-header\dcc-login-header-directive.html', where:

The final result is a windows wrong path and 404 not found error as is: http://localhost:3000/scripts/commondcc-login-headerdcc-login-header-directive.html

Sorry, I'am not able to debug yo generator...

johannesjo commented 9 years ago

Ok thanks again. I pushed another update. I'm pretty sure it should work now.

clabnet commented 9 years ago

Good patch, it work fine. Thank you, bravo!

johannesjo commented 9 years ago

Glad that it works!