File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11import { HtmlElementAst } from './html_ast' ;
22import { isBlank , isPresent } from 'angular2/src/facade/lang' ;
3+ import { splitNsName } from './html_tags' ;
34
45const NG_CONTENT_SELECT_ATTR = 'select' ;
56const NG_CONTENT_ELEMENT = 'ng-content' ;
@@ -31,7 +32,7 @@ export function preparseElement(ast: HtmlElementAst): PreparsedElement {
3132 selectAttr = normalizeNgContentSelect ( selectAttr ) ;
3233 var nodeName = ast . name . toLowerCase ( ) ;
3334 var type = PreparsedElementType . OTHER ;
34- if ( nodeName == NG_CONTENT_ELEMENT ) {
35+ if ( splitNsName ( nodeName ) [ 1 ] == NG_CONTENT_ELEMENT ) {
3536 type = PreparsedElementType . NG_CONTENT ;
3637 } else if ( nodeName == STYLE_ELEMENT ) {
3738 type = PreparsedElementType . STYLE ;
Original file line number Diff line number Diff line change @@ -106,6 +106,15 @@ export function main() {
106106 expect ( humanizeTplAst ( parsed ) ) . toEqual ( [ [ NgContentAst ] ] ) ;
107107 } ) ;
108108
109+ it ( 'should parse ngContent regardless the namespace' , ( ) => {
110+ var parsed = parse ( '<svg><ng-content></ng-content></svg>' , [ ] ) ;
111+ expect ( humanizeTplAst ( parsed ) )
112+ . toEqual ( [
113+ [ ElementAst , '@svg:svg' ] ,
114+ [ NgContentAst ] ,
115+ ] ) ;
116+ } ) ;
117+
109118 it ( 'should parse bound text nodes' , ( ) => {
110119 expect ( humanizeTplAst ( parse ( '{{a}}' , [ ] ) ) ) . toEqual ( [ [ BoundTextAst , '{{ a }}' ] ] ) ;
111120 } ) ;
You can’t perform that action at this time.
0 commit comments