backbone.js - How does the AngularJS router work for wildcards and pushstate? -
we investigating migration backbone angular. because of our design, need migrate router. i'd understand how wildcard routing works angular. here example of wildcard routing in backbone:
app.router = backbone.router.extend({ routes: { '*filter' : 'setfilter' }, setfilter: function(params) { //all traffic ends here. can grab url , go. var url = this.cdn + "templates/" + params + ".html"; ... } }); app.router = new app.router(); backbone.history.start({pushstate: true});
what angular equivalent wildcard routing?
how angular handle push state? specifically, have way utilize /pushstate urls when browser supports pushstate , automatically roll #pushstate hash urls ie9-
thanks.
1) there not current support regex in angular routing
2)angular automatically handle pushstate if not available in browser automatically fallback hash mode# use below lines
$locationprovider.html5mode(false); $locationprovider.hashprefix('!');
Comments
Post a Comment