Using angular-fullstack framework
I have installed fullstack angular and must follow the same structure for components.
I don't get any error, but the HTML doesn't work either.
This html handler should be rendered as soon as the app is loaded ie in '/', so where can I set the state for that? I have a controller file, html and javascript file.
music.js
as follows:
'use strict';
angular.module('Todo')
.config(function($stateProvider) {
$stateProvider
.state('music', {
url: '/',
templateUrl: 'app/music/music.html',
controller: 'MusicCtrl'
});
});
Since I have a '/' in the url, I assumed it music.html
would load when doing so. But it is so. This gives a blank page.
In the default framework they provide, they have a file that loads at this url. I have commented on this part and it should be fine though.
Do I have to change somewhere else to render it? I believe I have the code in place, and no erros as it worked with the express directories structure.
Can I get some pointers to using the angular-fullstack yeoman generated?
What else do I need to do to render it with a given url?
source to share
With an angular-full stack generator, you don't have to manually add routes. you can use
yo angular-fullstack:route myroute
so that the files are created for you. You will be prompted for a directory for the generated files and url.
In your case, answer '/' for the latter, then delete the "main" folder in / client / app. Now the '/' route will point to the files you just created.
Then you can copy the content of your HTML into the HTML file you just created in the subdirectory you named.
source to share