feat(View): add support for styleUrls and styles

fixes #2382
This commit is contained in:
Victor Berchet
2015-06-10 14:40:24 +02:00
parent f065a2ecb7
commit ac3e624d0f
12 changed files with 220 additions and 102 deletions

View File

@ -88,7 +88,7 @@ class _TemplateExtractor {
Future<_ExtractResult> extractTemplates(ViewDefinition viewDef) async {
// Check for "imperative views".
if (viewDef.template == null && viewDef.absUrl == null) return null;
if (viewDef.template == null && viewDef.templateAbsUrl == null) return null;
var templateEl = await _loader.load(viewDef);

View File

@ -210,11 +210,11 @@ class _TemplateExtractVisitor extends Object with RecursiveAstVisitor<Object> {
return null;
}
if (keyString == 'templateUrl') {
if (viewDef.absUrl != null) {
if (viewDef.templateAbsUrl != null) {
logger.error(
'Found multiple values for "templateUrl". Source: ${node}');
}
viewDef.absUrl = valueString;
viewDef.templateAbsUrl = valueString;
} else {
// keyString == 'template'
if (viewDef.template != null) {