fix(ivy): support for #id bootstrap selectors (#33784)
Fixes: #33485 PR Close #33784
This commit is contained in:

committed by
Alex Rickabaugh

parent
c5a75fd807
commit
ab0bcee144
36
packages/core/test/acceptance/bootstrap_spec.ts
Normal file
36
packages/core/test/acceptance/bootstrap_spec.ts
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {Component, NgModule} from '@angular/core';
|
||||
import {getComponentDef} from '@angular/core/src/render3/definition';
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
import {onlyInIvy, withBody} from '@angular/private/testing';
|
||||
|
||||
describe('bootstrap', () => {
|
||||
it('should bootstrap using #id selector', withBody('<div #my-app>', async() => {
|
||||
try {
|
||||
const ngModuleRef = await platformBrowserDynamic().bootstrapModule(MyAppModule);
|
||||
expect(document.body.textContent).toEqual('works!');
|
||||
ngModuleRef.destroy();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
@Component({
|
||||
selector: '#my-app',
|
||||
template: 'works!',
|
||||
})
|
||||
export class MyAppComponent {
|
||||
}
|
||||
|
||||
@NgModule({imports: [BrowserModule], declarations: [MyAppComponent], bootstrap: [MyAppComponent]})
|
||||
export class MyAppModule {
|
||||
}
|
Reference in New Issue
Block a user