Reputation: 1669
The instruction for routing in AngularDart recommend the following for development mode, but explicitly says not to use it for production:
// WARNING: DO NOT set the <base href> like this in production!
// Details: https://webdev.dartlang.org/angular/guide/router
(function () {
var m = document.location.pathname.match(/^(\/[-\w]+)+\/web($|\/)/);
document.write('<base href="' + (m ? m[0] : '/') + '" />');
}());
How can I conditionally include this code in development mode, only? I believe I know how to detect development mode in Dart code, but I'm not sure how to detect the mode and make the selection in JavaScript before any of the application code even loads.
Upvotes: 1
Views: 63