A
A
Abc Edc2015-05-03 20:31:24
Angular
Abc Edc, 2015-05-03 20:31:24

How to do routing when using angular on node?

Routing should be done, as I understand it, on a node like

app.get('/',function(req,res){
        res.sendFile(path.join(publicDir, 'index.html'));
    });

But what about Angular then?
.state('main', {
            url: "/",
            abstract: true,
            templateUrl: "templates/main.html",
            controller: 'AppCtrl',
            data: {
                requireLogin: false
            }
        })

Or is it enough to just specify the index on the node?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2015-05-03
@gleber1

Send index.html to any request, then Angular will destroy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question