{"id":370204,"date":"2024-05-21T04:19:55","date_gmt":"2024-05-21T04:19:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370204"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T04:19:55","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370204","title":{"rendered":"<span>\u0420\u0435\u0448\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430 Storybook 7<\/span>"},"content":{"rendered":"<div><!--[--><img loading=\"lazy\" decoding=\"async\" height=\"1\" src=\"https:\/\/mc.yandex.ru\/watch\/96703594\" style=\"display:none;\" width=\"1\"><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c9c\/f08\/715\/c9cf08715d29d3b7f85a46acf88de539.png\" width=\"1500\" height=\"900\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c9c\/f08\/715\/c9cf08715d29d3b7f85a46acf88de539.png\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 Skyeng. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 \u0448\u0435\u0441\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Storybook \u043d\u0430 \u0441\u0435\u0434\u044c\u043c\u0443\u044e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0430\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0430 <strong>\u00ab<\/strong>Providers from the<strong> <\/strong>BrowserModule have already been loaded. If you need access to common directives such as NgIf and NgFor, import the CommonModule instead\u00bb.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0431\u0430\u0433 \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430<\/h3>\n<p>BrowserModule \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442<strong> <\/strong>\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e<strong> <\/strong>Angular-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/angular.io\/guide\/frequent-ngmodules#browsermodule-and-commonmodule\">\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437<\/a>. \u0415\u0441\u043b\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 lazy-loaded feature-\u043c\u043e\u0434\u0443\u043b\u044c, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f CommonModule \u0432\u043c\u0435\u0441\u0442\u0435 \u0446\u0435\u043b\u043e\u0433\u043e BrowserModule. <\/p>\n<p>\u041f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 application-wide \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/h4>\n<pre><code class=\"typescript\">\/\/ feature.module.ts  @NgModule({   imports: [BrowserModule], \/\/ \u0437\u0434\u0435\u0441\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e   \u2026 }) export class FeatureModule { \u2026  \/\/ app.module.ts  @NgModule({   imports: [BrowserModule], \/\/ AppModule \u0443\u0436\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 BrowserModule   \u2026 }) export class AppModule { \u2026<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a\u00a0FeatureModule \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 BrowserModule, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443: \u00abProviders from the<strong> <\/strong>BrowserModule have already been loaded. If you need access to common directives such as NgIf and NgFor, import the CommonModule instead\u00bb.<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f Storybook, \u0442\u043e \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u043a \u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ storybook-helper.module.ts  @NgModule({   imports: [BrowserModule], \/\/ \u043f\u0435\u0440\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: StorybookHelperModule \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c BrowserModule   \u2026 }) export class StorybookHelperModule { \u2026  \/\/ test.stories.ts  export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     moduleMetadata({       imports: [StorybookHelperModule], \/\/ \u0432\u0442\u043e\u0440\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c BrowserModule, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 StorybookHelperModule     }),   ],<\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 Storybook \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 BrowserAnimationsModule\u00a0\/\u00a0BrowserModule, \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Storybook.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 BrowserModule \u0432\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0434\u043b\u044f \u0441\u0442\u043e\u0440\u0438\u0431\u0443\u043a\u0430. \u041d\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 BrowserModule \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u0438, \u0442\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0435 BrowserModule, \u043d\u043e \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041a\u0430\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443<\/h3>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 7-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, Storybook \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 <strong>bootstrapApplication API<\/strong>.\u00a0<\/p>\n<p>\u0412\u0441\u0435 application-wide \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044f BrowserModule \u0438 BrowserAnimationsModule, \u0442\u0435\u043f\u0435\u0440\u044c  \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/storybookjs\/storybook\/blob\/next\/MIGRATION.md#angular-application-providers-and-modulewithproviders\"><strong>applicationConfig <\/strong><\/a>\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ test.stories.ts  export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     applicationConfig({  \/\/ \u043d\u043e\u0432\u044b\u0439 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440       providers: [importProvidersFrom(BrowserAnimationsModule)],     }),   ], <\/code><\/pre>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0432\u0441\u0435\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d forRoot). \u0418\u0445 \u0442\u043e\u0436\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 applicationConfig \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440.<\/p>\n<p><strong>\u0411\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"typescript\">export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     moduleMetadata({       imports: [SomeModule.forRoot()],     }),   ], <\/code><\/pre>\n<p><strong>\u0421\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"typescript\">export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     applicationConfig({ \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440       providers: [importProvidersFrom(SomeModule.forRoot())],     }),   ] <\/code><\/pre>\n<h3>\u0412\u044b\u0432\u043e\u0434<\/h3>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043c\u043e\u0434\u0443\u043b\u044c, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u0441 7-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Storybook \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c applicationConfig \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440, \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c application-wide \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0438\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u2014\u00a0\u043f\u0438\u0448\u0438\u0442\u0435, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/798697\/\"> https:\/\/habr.com\/ru\/articles\/798697\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u044f \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 Skyeng. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 \u0448\u0435\u0441\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Storybook \u043d\u0430 \u0441\u0435\u0434\u044c\u043c\u0443\u044e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0430\u0441\u044c \u043e\u0448\u0438\u0431\u043a\u0430 <strong>\u00ab<\/strong>Providers from the<strong> <\/strong>BrowserModule have already been loaded. If you need access to common directives such as NgIf and NgFor, import the CommonModule instead\u00bb.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e, \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0431\u0430\u0433 \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430<\/h3>\n<p>BrowserModule \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442<strong> <\/strong>\u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e<strong> <\/strong>Angular-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0435\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/angular.io\/guide\/frequent-ngmodules#browsermodule-and-commonmodule\">\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437<\/a>. \u0415\u0441\u043b\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 lazy-loaded feature-\u043c\u043e\u0434\u0443\u043b\u044c, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f CommonModule \u0432\u043c\u0435\u0441\u0442\u0435 \u0446\u0435\u043b\u043e\u0433\u043e BrowserModule. <\/p>\n<p>\u041f\u043e \u0442\u0430\u043a\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 application-wide \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/h4>\n<pre><code class=\"typescript\">\/\/ feature.module.ts  @NgModule({   imports: [BrowserModule], \/\/ \u0437\u0434\u0435\u0441\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e   \u2026 }) export class FeatureModule { \u2026  \/\/ app.module.ts  @NgModule({   imports: [BrowserModule], \/\/ AppModule \u0443\u0436\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 BrowserModule   \u2026 }) export class AppModule { \u2026<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a\u00a0FeatureModule \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0438\u043c\u043f\u043e\u0440\u0442 BrowserModule, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443: \u00abProviders from the<strong> <\/strong>BrowserModule have already been loaded. If you need access to common directives such as NgIf and NgFor, import the CommonModule instead\u00bb.<\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f Storybook, \u0442\u043e \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u043a \u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ storybook-helper.module.ts  @NgModule({   imports: [BrowserModule], \/\/ \u043f\u0435\u0440\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: StorybookHelperModule \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c BrowserModule   \u2026 }) export class StorybookHelperModule { \u2026  \/\/ test.stories.ts  export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     moduleMetadata({       imports: [StorybookHelperModule], \/\/ \u0432\u0442\u043e\u0440\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c BrowserModule, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 StorybookHelperModule     }),   ],<\/code><\/pre>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0432 Storybook \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 BrowserAnimationsModule\u00a0\/\u00a0BrowserModule, \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Storybook.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u044b\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 BrowserModule \u0432\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0434\u043b\u044f \u0441\u0442\u043e\u0440\u0438\u0431\u0443\u043a\u0430. \u041d\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 BrowserModule \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u0438, \u0442\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0435 BrowserModule, \u043d\u043e \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041a\u0430\u043a \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443<\/h3>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 7-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, Storybook \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 <strong>bootstrapApplication API<\/strong>.\u00a0<\/p>\n<p>\u0412\u0441\u0435 application-wide \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044f BrowserModule \u0438 BrowserAnimationsModule, \u0442\u0435\u043f\u0435\u0440\u044c  \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/storybookjs\/storybook\/blob\/next\/MIGRATION.md#angular-application-providers-and-modulewithproviders\"><strong>applicationConfig <\/strong><\/a>\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"typescript\">\/\/ test.stories.ts  export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     applicationConfig({  \/\/ \u043d\u043e\u0432\u044b\u0439 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440       providers: [importProvidersFrom(BrowserAnimationsModule)],     }),   ], <\/code><\/pre>\n<p>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0432\u0441\u0435\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d forRoot). \u0418\u0445 \u0442\u043e\u0436\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 applicationConfig \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440.<\/p>\n<p><strong>\u0411\u044b\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"typescript\">export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     moduleMetadata({       imports: [SomeModule.forRoot()],     }),   ], <\/code><\/pre>\n<p><strong>\u0421\u0442\u0430\u043b\u043e:<\/strong><\/p>\n<pre><code class=\"typescript\">export default {   title: 'TestComponent',   component: TestComponent,   decorators: [     applicationConfig({ \/\/ \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440       providers: [importProvidersFrom(SomeModule.forRoot())],     }),   ] <\/code><\/pre>\n<h3>\u0412\u044b\u0432\u043e\u0434<\/h3>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043c\u043e\u0434\u0443\u043b\u044c, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d \u043d\u0443\u0436\u0435\u043d \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u0441 7-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Storybook \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c applicationConfig \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440, \u0435\u0441\u043b\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c application-wide \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0438\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u2014\u00a0\u043f\u0438\u0448\u0438\u0442\u0435, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/798697\/\"> https:\/\/habr.com\/ru\/articles\/798697\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-370204","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=370204"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370204\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}