dart - AngularDart View is not properly routing -


i'm new dart , i'm having issues views/router.

the router in lib/routing/booking_service_router.dart:

void bookingservicerouteinitializer(router router, routeviewfactory views) {    views.configure({     'reservations': ngroute(             path: '/reservations',             view: 'view/homereservation.html')   }); } 

the main module bookingservice.dart:

class bookingservicemodule extends module {     bookingservicemodule() {     bind(reservationhome);     bind(tabmenu);     bind(routeinitializerfn, tovalue: bookingservicerouteinitializer);     bind(ngroutingusepushstate, tovalue: new ngroutingusepushstate.value(false));   } }  void main() {   logger.root.level = level.finest;   logger.root.onrecord.listen((logrecord r) { print(r.message); });   applicationfactory().addmodule(new bookingservicemodule()).run(); } 

the main html bookingservice.html:

<html>   <head>     <meta charset="utf-8">     <meta name="viewport" content="width=device-width, initial-scale=1">     <title>bookingservice</title>     <link rel="stylesheet" href="bookingservice.css">   </head>   <body>    <tab-menu ng-cloak></tab-menu>     <div>     <section>       <ng-view></ng-view>     </section>     </div>    <script type="application/dart" src="bookingservice.dart"></script>   <script type="text/javascript" src="packages/browser/dart.js"></script>    </body> </html> 

and /lib/component/tab_menu.html:

<link rel="stylesheet" href="tab_menu.css">  <div>     <ul>     <li>       <a href="#/reservations">click this</a>     </li>   </ul> </div> 

and view trying route web/view/homereservation.html:

<div>   <h1>hello!</h1> </div> 

when click link route homereservation.html need route url path: http://127.0.0.1:3030/bookingservice/web/bookingservice.html#/reservations

however, url routes is: http://127.0.0.1:3030/bookingservice/web/bookingservice/packages/bookingservice/component/tab_menu.html#/reservations

which takes same view , not showing homereservation.html.

any pointers/tips/advice on may missing?

thanks!

i got working changing name of index bookingservice.html index.html. not sure why need have index.html work properly. if has reason behind please feel free comment below. i'll more digging on reason.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

gradle error "Cannot convert the provided notation to a File or URI" -