pdonorio / angulask

A project to template flask web server to meet angularjs
0 stars 0 forks source link

Routing #9

Closed pdonorio closed 8 years ago

pdonorio commented 8 years ago

Reaching url and parameters to python and javascript a the same time. Is it possible?

The problem

We will route pages with flask views, e.g.

app.route('/myview/<int:id>')
def myview():
    return render_template('mypage.html')

This snippet provide mypage.html template with interpreted python to the URL http://mywebsite.com/myview or when adding the id like http://mywebsite.com/myview/42

Once we access /myview/42 by URL we want to use the element 42 in our Table. At this point who is going to select the data on the API side? Angular? How to recover '42' with angularjs when the routing is done by Flask?

pdonorio commented 8 years ago

@mdantonio we may discuss this tomorrow, in chat/video

pdonorio commented 8 years ago

My theory:

I can write a small test in my branch, independent from the actual app where we already have some code.

pdonorio commented 8 years ago

Ok, so HTML 5 mode went well

:happy: