मैं कोणीय 2 डार्ट में राउटर और रूटपेराम का उपयोग कर रहा हूं।मैं कोणीय 2 डार्ट का उपयोग कर पेज रीलोड पर रूट पैराम्स का समर्थन कैसे करूं?
@RouteConfig(const [
const Route(path: '/', component: ViewLanding, as: 'home'),
const Route(path: '/landing', component: ViewLanding, as: 'landing'),
const Route(path: '/flights', component: ViewFlights, as: 'flights'),
const Route(path: '/picker/:cityDepart/:cityArrival/:dateDepart/:dateArrival/', component: ViewFlights, as: 'picker'),
const Route(path: '/order/:id/:level/:dateDepart/:dateArrival/', component: ViewOrder, as: 'order'),
const Route(path: '/order/complete', component: ViewComplete, as: 'orderComplete')
])
// आवेदन प्रवेश बिंदु:
void main() {
print('-- Main.dart 2 --');
bootstrap(Tickets, [
routerInjectables,
client_classes,
// The base path of your application
bind(APP_BASE_HREF).toValue('/'),
// uncomment this if you want to use '#' in your url
bind(LocationStrategy).toClass(HashLocationStrategy)
]);
}
इस रूटर-आउटलेट/रूटर-लिंक के साथ ठीक काम करता है/router.navigate
हालांकि
मेरे मार्गों निम्न हैं , पृष्ठ रीलोड पर - मुझे पैरा के साथ मार्गों के लिए सकारात्मक मिलान नहीं मिलता है। आईई: अगर मैं http://localhost:8080/#/picker/SAN/SFO/2015-01-01/2015-04-02
रीफ्रेश करता हूं - मैं बिना किसी बच्चे के मार्ग के माता-पिता के दृश्य पर जाता हूं। यह लक्षण पैराम के साथ किसी भी मार्ग के लिए सच है।
करने के लिए या करने के लिए ताज़ा सीधे नेविगेट: http://localhost:8080/#/flights/
- काम करता है के रूप में उम्मीद - ViewFlights घटक instantiated है
लक्षण: पैरामीटर वाला मार्ग विफल रहता है।
प्रश्न: मैं कैसे ताज़ा करने पर मापदंडों
लिंक के साथ काम करने के लिए मार्ग विन्यास को परिभाषित करते हैं: https://github.com/rightisleft/web_apps_dart/blob/angular2/web/main.dart https://github.com/rightisleft/web_apps_dart/blob/angular2/lib/client/tickets.dart
आप इस पर एक समाधान के साथ खत्म किया था के बाद? – Pacane
यह अल्फा 31 में तय किया जाना था (देखें [मुद्दा] (https://github.com/angular/angular/issues/2920) और [फिक्स] (https://github.com/angular/angular/commit/ c177d88)), हालांकि यह केवल यूआरएल के लिए ही दिखता है, पैराम नहीं। यह समीक्षा के लिए अपने गिट में जारी किया जाना चाहिए। –
मैंने अभी इसे अल्फा 37 –