[Flow] Angular 2.3 + Flow 3.1 Routing
Sebastian Wojtowicz
trust.sebastian at gmail.com
Fri Dec 16 23:01:46 CET 2016
Hey friendly people ;)
Just a short question.
I have the Angular 2.3 Heroes Tutorial Code running.
I have server side communication with Flow and Rest.
I'm having problems with the routing of all the possible angular2-defined routes (like heroes, dashboard, detail/12) to one single flow3-defined route.
Detail:
I'd like to have all non-matching routes to route to my HeroesController/IndexAction, so 'heroes' should go there, 'dashboard', 'detail/12', but also some futuristic 'xyz/hero/jump/to/hero/5' should go there, too, for now.
The REST api/xxx routes I've defined manually of course, and this works.
Is this possible, does it make sense ? It's my first time that I want to do such a REST focused application (+ first project with angular2) and it has been a long time since I've been playing with Flow. But I thought it would make sense to do it this way, because for now I'll have only one single html entry point for every possible angular2 route and angular2 should then do it's routing decisions by it self.
This is what I've got so far:
-
name: 'nothing'
uriPattern: ''
defaults:
'@package': 'My.Package'
'@controller': 'Heroes'
'@action': 'index'
-
name: 'api/heroes/{id}'
uriPattern: 'api/heroes/{id}'
defaults:
'@package' : 'My.Package'
'@controller' : 'Rest\Heroes'
'@action' : 'show'
httpMethods: ['GET']
-
name: 'all'
uriPattern: '({all})'
defaults:
'@package': 'My.Package'
'@controller': 'Heroes'
'@action': 'index'
'@format': 'html'
More information about the Flow
mailing list