2015-08-24 20:24:01 -04:00
|
|
|
library ng_material.test_url_resolver;
|
|
|
|
|
2015-11-17 18:24:36 -05:00
|
|
|
import 'package:angular2/src/platform/browser/browser_adapter.dart';
|
2015-11-05 17:07:57 -05:00
|
|
|
import 'package:angular2/src/compiler/url_resolver.dart';
|
2015-08-24 20:24:01 -04:00
|
|
|
|
|
|
|
void commonDemoSetup() {
|
|
|
|
BrowserDomAdapter.makeCurrent();
|
|
|
|
}
|
|
|
|
|
|
|
|
class TestUrlResolver extends UrlResolver {
|
|
|
|
@override
|
|
|
|
String resolve(String baseUrl, String url) {
|
|
|
|
const MATERIAL_PKG = 'package:angular2_material/';
|
|
|
|
|
|
|
|
if (url.startsWith(MATERIAL_PKG)) {
|
|
|
|
return '/packages/angular2_material/' +
|
|
|
|
url.substring(MATERIAL_PKG.length);
|
|
|
|
}
|
|
|
|
return super.resolve(baseUrl, url);
|
|
|
|
}
|
|
|
|
}
|