platform-browser-dynamic.umd.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. /**
  2. * @license Angular v8.1.0
  3. * (c) 2010-2019 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/compiler'), require('@angular/core'), require('@angular/common'), require('@angular/platform-browser')) :
  8. typeof define === 'function' && define.amd ? define('@angular/platform-browser-dynamic', ['exports', '@angular/compiler', '@angular/core', '@angular/common', '@angular/platform-browser'], factory) :
  9. (global = global || self, factory((global.ng = global.ng || {}, global.ng.platformBrowserDynamic = {}), global.ng.compiler, global.ng.core, global.ng.common, global.ng.platformBrowser));
  10. }(this, function (exports, compiler, core, common, platformBrowser) { 'use strict';
  11. /*! *****************************************************************************
  12. Copyright (c) Microsoft Corporation. All rights reserved.
  13. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  14. this file except in compliance with the License. You may obtain a copy of the
  15. License at http://www.apache.org/licenses/LICENSE-2.0
  16. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  18. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  19. MERCHANTABLITY OR NON-INFRINGEMENT.
  20. See the Apache Version 2.0 License for specific language governing permissions
  21. and limitations under the License.
  22. ***************************************************************************** */
  23. /* global Reflect, Promise */
  24. var extendStatics = function(d, b) {
  25. extendStatics = Object.setPrototypeOf ||
  26. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  27. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  28. return extendStatics(d, b);
  29. };
  30. function __extends(d, b) {
  31. extendStatics(d, b);
  32. function __() { this.constructor = d; }
  33. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  34. }
  35. function __decorate(decorators, target, key, desc) {
  36. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  37. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  38. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  39. return c > 3 && r && Object.defineProperty(target, key, r), r;
  40. }
  41. function __read(o, n) {
  42. var m = typeof Symbol === "function" && o[Symbol.iterator];
  43. if (!m) return o;
  44. var i = m.call(o), r, ar = [], e;
  45. try {
  46. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  47. }
  48. catch (error) { e = { error: error }; }
  49. finally {
  50. try {
  51. if (r && !r.done && (m = i["return"])) m.call(i);
  52. }
  53. finally { if (e) throw e.error; }
  54. }
  55. return ar;
  56. }
  57. function __spread() {
  58. for (var ar = [], i = 0; i < arguments.length; i++)
  59. ar = ar.concat(__read(arguments[i]));
  60. return ar;
  61. }
  62. /**
  63. * @license
  64. * Copyright Google Inc. All Rights Reserved.
  65. *
  66. * Use of this source code is governed by an MIT-style license that can be
  67. * found in the LICENSE file at https://angular.io/license
  68. */
  69. var MODULE_SUFFIX = '';
  70. var builtinExternalReferences = createBuiltinExternalReferencesMap();
  71. var JitReflector = /** @class */ (function () {
  72. function JitReflector() {
  73. this.reflectionCapabilities = new core.ɵReflectionCapabilities();
  74. }
  75. JitReflector.prototype.componentModuleUrl = function (type, cmpMetadata) {
  76. var moduleId = cmpMetadata.moduleId;
  77. if (typeof moduleId === 'string') {
  78. var scheme = compiler.getUrlScheme(moduleId);
  79. return scheme ? moduleId : "package:" + moduleId + MODULE_SUFFIX;
  80. }
  81. else if (moduleId !== null && moduleId !== void 0) {
  82. throw compiler.syntaxError("moduleId should be a string in \"" + core.ɵstringify(type) + "\". See https://goo.gl/wIDDiL for more information.\n" +
  83. "If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.");
  84. }
  85. return "./" + core.ɵstringify(type);
  86. };
  87. JitReflector.prototype.parameters = function (typeOrFunc) {
  88. return this.reflectionCapabilities.parameters(typeOrFunc);
  89. };
  90. JitReflector.prototype.tryAnnotations = function (typeOrFunc) { return this.annotations(typeOrFunc); };
  91. JitReflector.prototype.annotations = function (typeOrFunc) {
  92. return this.reflectionCapabilities.annotations(typeOrFunc);
  93. };
  94. JitReflector.prototype.shallowAnnotations = function (typeOrFunc) {
  95. throw new Error('Not supported in JIT mode');
  96. };
  97. JitReflector.prototype.propMetadata = function (typeOrFunc) {
  98. return this.reflectionCapabilities.propMetadata(typeOrFunc);
  99. };
  100. JitReflector.prototype.hasLifecycleHook = function (type, lcProperty) {
  101. return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
  102. };
  103. JitReflector.prototype.guards = function (type) { return this.reflectionCapabilities.guards(type); };
  104. JitReflector.prototype.resolveExternalReference = function (ref) {
  105. return builtinExternalReferences.get(ref) || ref.runtime;
  106. };
  107. return JitReflector;
  108. }());
  109. function createBuiltinExternalReferencesMap() {
  110. var map = new Map();
  111. map.set(compiler.Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS, core.ANALYZE_FOR_ENTRY_COMPONENTS);
  112. map.set(compiler.Identifiers.ElementRef, core.ElementRef);
  113. map.set(compiler.Identifiers.NgModuleRef, core.NgModuleRef);
  114. map.set(compiler.Identifiers.ViewContainerRef, core.ViewContainerRef);
  115. map.set(compiler.Identifiers.ChangeDetectorRef, core.ChangeDetectorRef);
  116. map.set(compiler.Identifiers.Renderer2, core.Renderer2);
  117. map.set(compiler.Identifiers.QueryList, core.QueryList);
  118. map.set(compiler.Identifiers.TemplateRef, core.TemplateRef);
  119. map.set(compiler.Identifiers.CodegenComponentFactoryResolver, core.ɵCodegenComponentFactoryResolver);
  120. map.set(compiler.Identifiers.ComponentFactoryResolver, core.ComponentFactoryResolver);
  121. map.set(compiler.Identifiers.ComponentFactory, core.ComponentFactory);
  122. map.set(compiler.Identifiers.ComponentRef, core.ComponentRef);
  123. map.set(compiler.Identifiers.NgModuleFactory, core.NgModuleFactory);
  124. map.set(compiler.Identifiers.createModuleFactory, core.ɵcmf);
  125. map.set(compiler.Identifiers.moduleDef, core.ɵmod);
  126. map.set(compiler.Identifiers.moduleProviderDef, core.ɵmpd);
  127. map.set(compiler.Identifiers.RegisterModuleFactoryFn, core.ɵregisterModuleFactory);
  128. map.set(compiler.Identifiers.Injector, core.Injector);
  129. map.set(compiler.Identifiers.ViewEncapsulation, core.ViewEncapsulation);
  130. map.set(compiler.Identifiers.ChangeDetectionStrategy, core.ChangeDetectionStrategy);
  131. map.set(compiler.Identifiers.SecurityContext, core.SecurityContext);
  132. map.set(compiler.Identifiers.LOCALE_ID, core.LOCALE_ID);
  133. map.set(compiler.Identifiers.TRANSLATIONS_FORMAT, core.TRANSLATIONS_FORMAT);
  134. map.set(compiler.Identifiers.inlineInterpolate, core.ɵinlineInterpolate);
  135. map.set(compiler.Identifiers.interpolate, core.ɵinterpolate);
  136. map.set(compiler.Identifiers.EMPTY_ARRAY, core.ɵEMPTY_ARRAY);
  137. map.set(compiler.Identifiers.EMPTY_MAP, core.ɵEMPTY_MAP);
  138. map.set(compiler.Identifiers.Renderer, core.Renderer);
  139. map.set(compiler.Identifiers.viewDef, core.ɵvid);
  140. map.set(compiler.Identifiers.elementDef, core.ɵeld);
  141. map.set(compiler.Identifiers.anchorDef, core.ɵand);
  142. map.set(compiler.Identifiers.textDef, core.ɵted);
  143. map.set(compiler.Identifiers.directiveDef, core.ɵdid);
  144. map.set(compiler.Identifiers.providerDef, core.ɵprd);
  145. map.set(compiler.Identifiers.queryDef, core.ɵqud);
  146. map.set(compiler.Identifiers.pureArrayDef, core.ɵpad);
  147. map.set(compiler.Identifiers.pureObjectDef, core.ɵpod);
  148. map.set(compiler.Identifiers.purePipeDef, core.ɵppd);
  149. map.set(compiler.Identifiers.pipeDef, core.ɵpid);
  150. map.set(compiler.Identifiers.nodeValue, core.ɵnov);
  151. map.set(compiler.Identifiers.ngContentDef, core.ɵncd);
  152. map.set(compiler.Identifiers.unwrapValue, core.ɵunv);
  153. map.set(compiler.Identifiers.createRendererType2, core.ɵcrt);
  154. map.set(compiler.Identifiers.createComponentFactory, core.ɵccf);
  155. return map;
  156. }
  157. /**
  158. * @license
  159. * Copyright Google Inc. All Rights Reserved.
  160. *
  161. * Use of this source code is governed by an MIT-style license that can be
  162. * found in the LICENSE file at https://angular.io/license
  163. */
  164. var ERROR_COLLECTOR_TOKEN = new core.InjectionToken('ErrorCollector');
  165. /**
  166. * A default provider for {@link PACKAGE_ROOT_URL} that maps to '/'.
  167. */
  168. var DEFAULT_PACKAGE_URL_PROVIDER = {
  169. provide: core.PACKAGE_ROOT_URL,
  170. useValue: '/'
  171. };
  172. var _NO_RESOURCE_LOADER = {
  173. get: function (url) {
  174. throw new Error("No ResourceLoader implementation has been provided. Can't read the url \"" + url + "\"");
  175. }
  176. };
  177. var baseHtmlParser = new core.InjectionToken('HtmlParser');
  178. var CompilerImpl = /** @class */ (function () {
  179. function CompilerImpl(injector, _metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, jitEvaluator, compilerConfig, console) {
  180. this._metadataResolver = _metadataResolver;
  181. this._delegate = new compiler.JitCompiler(_metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, jitEvaluator, compilerConfig, console, this.getExtraNgModuleProviders.bind(this));
  182. this.injector = injector;
  183. }
  184. CompilerImpl.prototype.getExtraNgModuleProviders = function () {
  185. return [this._metadataResolver.getProviderMetadata(new compiler.ProviderMeta(core.Compiler, { useValue: this }))];
  186. };
  187. CompilerImpl.prototype.compileModuleSync = function (moduleType) {
  188. return this._delegate.compileModuleSync(moduleType);
  189. };
  190. CompilerImpl.prototype.compileModuleAsync = function (moduleType) {
  191. return this._delegate.compileModuleAsync(moduleType);
  192. };
  193. CompilerImpl.prototype.compileModuleAndAllComponentsSync = function (moduleType) {
  194. var result = this._delegate.compileModuleAndAllComponentsSync(moduleType);
  195. return {
  196. ngModuleFactory: result.ngModuleFactory,
  197. componentFactories: result.componentFactories,
  198. };
  199. };
  200. CompilerImpl.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {
  201. return this._delegate.compileModuleAndAllComponentsAsync(moduleType)
  202. .then(function (result) { return ({
  203. ngModuleFactory: result.ngModuleFactory,
  204. componentFactories: result.componentFactories,
  205. }); });
  206. };
  207. CompilerImpl.prototype.loadAotSummaries = function (summaries) { this._delegate.loadAotSummaries(summaries); };
  208. CompilerImpl.prototype.hasAotSummary = function (ref) { return this._delegate.hasAotSummary(ref); };
  209. CompilerImpl.prototype.getComponentFactory = function (component) {
  210. return this._delegate.getComponentFactory(component);
  211. };
  212. CompilerImpl.prototype.clearCache = function () { this._delegate.clearCache(); };
  213. CompilerImpl.prototype.clearCacheFor = function (type) { this._delegate.clearCacheFor(type); };
  214. CompilerImpl.prototype.getModuleId = function (moduleType) {
  215. var meta = this._metadataResolver.getNgModuleMetadata(moduleType);
  216. return meta && meta.id || undefined;
  217. };
  218. return CompilerImpl;
  219. }());
  220. /**
  221. * A set of providers that provide `JitCompiler` and its dependencies to use for
  222. * template compilation.
  223. */
  224. var COMPILER_PROVIDERS = [
  225. { provide: compiler.CompileReflector, useValue: new JitReflector() },
  226. { provide: compiler.ResourceLoader, useValue: _NO_RESOURCE_LOADER },
  227. { provide: compiler.JitSummaryResolver, deps: [] },
  228. { provide: compiler.SummaryResolver, useExisting: compiler.JitSummaryResolver },
  229. { provide: core.ɵConsole, deps: [] },
  230. { provide: compiler.Lexer, deps: [] },
  231. { provide: compiler.Parser, deps: [compiler.Lexer] },
  232. {
  233. provide: baseHtmlParser,
  234. useClass: compiler.HtmlParser,
  235. deps: [],
  236. },
  237. {
  238. provide: compiler.I18NHtmlParser,
  239. useFactory: function (parser, translations, format, config, console) {
  240. translations = translations || '';
  241. var missingTranslation = translations ? config.missingTranslation : core.MissingTranslationStrategy.Ignore;
  242. return new compiler.I18NHtmlParser(parser, translations, format, missingTranslation, console);
  243. },
  244. deps: [
  245. baseHtmlParser,
  246. [new core.Optional(), new core.Inject(core.TRANSLATIONS)],
  247. [new core.Optional(), new core.Inject(core.TRANSLATIONS_FORMAT)],
  248. [compiler.CompilerConfig],
  249. [core.ɵConsole],
  250. ]
  251. },
  252. {
  253. provide: compiler.HtmlParser,
  254. useExisting: compiler.I18NHtmlParser,
  255. },
  256. {
  257. provide: compiler.TemplateParser, deps: [compiler.CompilerConfig, compiler.CompileReflector,
  258. compiler.Parser, compiler.ElementSchemaRegistry,
  259. compiler.I18NHtmlParser, core.ɵConsole]
  260. },
  261. { provide: compiler.JitEvaluator, useClass: compiler.JitEvaluator, deps: [] },
  262. { provide: compiler.DirectiveNormalizer, deps: [compiler.ResourceLoader, compiler.UrlResolver, compiler.HtmlParser, compiler.CompilerConfig] },
  263. { provide: compiler.CompileMetadataResolver, deps: [compiler.CompilerConfig, compiler.HtmlParser, compiler.NgModuleResolver,
  264. compiler.DirectiveResolver, compiler.PipeResolver,
  265. compiler.SummaryResolver,
  266. compiler.ElementSchemaRegistry,
  267. compiler.DirectiveNormalizer, core.ɵConsole,
  268. [core.Optional, compiler.StaticSymbolCache],
  269. compiler.CompileReflector,
  270. [core.Optional, ERROR_COLLECTOR_TOKEN]] },
  271. DEFAULT_PACKAGE_URL_PROVIDER,
  272. { provide: compiler.StyleCompiler, deps: [compiler.UrlResolver] },
  273. { provide: compiler.ViewCompiler, deps: [compiler.CompileReflector] },
  274. { provide: compiler.NgModuleCompiler, deps: [compiler.CompileReflector] },
  275. { provide: compiler.CompilerConfig, useValue: new compiler.CompilerConfig() },
  276. { provide: core.Compiler, useClass: CompilerImpl, deps: [core.Injector, compiler.CompileMetadataResolver,
  277. compiler.TemplateParser, compiler.StyleCompiler,
  278. compiler.ViewCompiler, compiler.NgModuleCompiler,
  279. compiler.SummaryResolver, compiler.CompileReflector, compiler.JitEvaluator, compiler.CompilerConfig,
  280. core.ɵConsole] },
  281. { provide: compiler.DomElementSchemaRegistry, deps: [] },
  282. { provide: compiler.ElementSchemaRegistry, useExisting: compiler.DomElementSchemaRegistry },
  283. { provide: compiler.UrlResolver, deps: [core.PACKAGE_ROOT_URL] },
  284. { provide: compiler.DirectiveResolver, deps: [compiler.CompileReflector] },
  285. { provide: compiler.PipeResolver, deps: [compiler.CompileReflector] },
  286. { provide: compiler.NgModuleResolver, deps: [compiler.CompileReflector] },
  287. ];
  288. /**
  289. * @publicApi
  290. */
  291. var JitCompilerFactory = /** @class */ (function () {
  292. /* @internal */
  293. function JitCompilerFactory(defaultOptions) {
  294. var compilerOptions = {
  295. useJit: true,
  296. defaultEncapsulation: core.ViewEncapsulation.Emulated,
  297. missingTranslation: core.MissingTranslationStrategy.Warning,
  298. };
  299. this._defaultOptions = __spread([compilerOptions], defaultOptions);
  300. }
  301. JitCompilerFactory.prototype.createCompiler = function (options) {
  302. if (options === void 0) { options = []; }
  303. var opts = _mergeOptions(this._defaultOptions.concat(options));
  304. var injector = core.Injector.create([
  305. COMPILER_PROVIDERS, {
  306. provide: compiler.CompilerConfig,
  307. useFactory: function () {
  308. return new compiler.CompilerConfig({
  309. // let explicit values from the compiler options overwrite options
  310. // from the app providers
  311. useJit: opts.useJit,
  312. jitDevMode: core.isDevMode(),
  313. // let explicit values from the compiler options overwrite options
  314. // from the app providers
  315. defaultEncapsulation: opts.defaultEncapsulation,
  316. missingTranslation: opts.missingTranslation,
  317. preserveWhitespaces: opts.preserveWhitespaces,
  318. });
  319. },
  320. deps: []
  321. },
  322. opts.providers
  323. ]);
  324. return injector.get(core.Compiler);
  325. };
  326. return JitCompilerFactory;
  327. }());
  328. function _mergeOptions(optionsArr) {
  329. return {
  330. useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),
  331. defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),
  332. providers: _mergeArrays(optionsArr.map(function (options) { return options.providers; })),
  333. missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),
  334. preserveWhitespaces: _lastDefined(optionsArr.map(function (options) { return options.preserveWhitespaces; })),
  335. };
  336. }
  337. function _lastDefined(args) {
  338. for (var i = args.length - 1; i >= 0; i--) {
  339. if (args[i] !== undefined) {
  340. return args[i];
  341. }
  342. }
  343. return undefined;
  344. }
  345. function _mergeArrays(parts) {
  346. var result = [];
  347. parts.forEach(function (part) { return part && result.push.apply(result, __spread(part)); });
  348. return result;
  349. }
  350. /**
  351. * @license
  352. * Copyright Google Inc. All Rights Reserved.
  353. *
  354. * Use of this source code is governed by an MIT-style license that can be
  355. * found in the LICENSE file at https://angular.io/license
  356. */
  357. var ɵ0 = {};
  358. /**
  359. * A platform that included corePlatform and the compiler.
  360. *
  361. * @publicApi
  362. */
  363. var platformCoreDynamic = core.createPlatformFactory(core.platformCore, 'coreDynamic', [
  364. { provide: core.COMPILER_OPTIONS, useValue: ɵ0, multi: true },
  365. { provide: core.CompilerFactory, useClass: JitCompilerFactory, deps: [core.COMPILER_OPTIONS] },
  366. ]);
  367. var ResourceLoaderImpl = /** @class */ (function (_super) {
  368. __extends(ResourceLoaderImpl, _super);
  369. function ResourceLoaderImpl() {
  370. return _super !== null && _super.apply(this, arguments) || this;
  371. }
  372. ResourceLoaderImpl.prototype.get = function (url) {
  373. var resolve;
  374. var reject;
  375. var promise = new Promise(function (res, rej) {
  376. resolve = res;
  377. reject = rej;
  378. });
  379. var xhr = new XMLHttpRequest();
  380. xhr.open('GET', url, true);
  381. xhr.responseType = 'text';
  382. xhr.onload = function () {
  383. // responseText is the old-school way of retrieving response (supported by IE8 & 9)
  384. // response/responseType properties were introduced in ResourceLoader Level2 spec (supported
  385. // by IE10)
  386. var response = xhr.response || xhr.responseText;
  387. // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
  388. var status = xhr.status === 1223 ? 204 : xhr.status;
  389. // fix status code when it is 0 (0 status is undocumented).
  390. // Occurs when accessing file resources or on Android 4.1 stock browser
  391. // while retrieving files from application cache.
  392. if (status === 0) {
  393. status = response ? 200 : 0;
  394. }
  395. if (200 <= status && status <= 300) {
  396. resolve(response);
  397. }
  398. else {
  399. reject("Failed to load " + url);
  400. }
  401. };
  402. xhr.onerror = function () { reject("Failed to load " + url); };
  403. xhr.send();
  404. return promise;
  405. };
  406. ResourceLoaderImpl = __decorate([
  407. core.Injectable()
  408. ], ResourceLoaderImpl);
  409. return ResourceLoaderImpl;
  410. }(compiler.ResourceLoader));
  411. /**
  412. * @license
  413. * Copyright Google Inc. All Rights Reserved.
  414. *
  415. * Use of this source code is governed by an MIT-style license that can be
  416. * found in the LICENSE file at https://angular.io/license
  417. */
  418. var ɵ0$1 = { providers: [{ provide: compiler.ResourceLoader, useClass: ResourceLoaderImpl, deps: [] }] }, ɵ1 = common.ɵPLATFORM_BROWSER_ID;
  419. /**
  420. * @publicApi
  421. */
  422. var INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [
  423. platformBrowser.ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS,
  424. {
  425. provide: core.COMPILER_OPTIONS,
  426. useValue: ɵ0$1,
  427. multi: true
  428. },
  429. { provide: core.PLATFORM_ID, useValue: ɵ1 },
  430. ];
  431. /**
  432. * @license
  433. * Copyright Google Inc. All Rights Reserved.
  434. *
  435. * Use of this source code is governed by an MIT-style license that can be
  436. * found in the LICENSE file at https://angular.io/license
  437. */
  438. /**
  439. * An implementation of ResourceLoader that uses a template cache to avoid doing an actual
  440. * ResourceLoader.
  441. *
  442. * The template cache needs to be built and loaded into window.$templateCache
  443. * via a separate mechanism.
  444. *
  445. * @publicApi
  446. */
  447. var CachedResourceLoader = /** @class */ (function (_super) {
  448. __extends(CachedResourceLoader, _super);
  449. function CachedResourceLoader() {
  450. var _this = _super.call(this) || this;
  451. _this._cache = core.ɵglobal.$templateCache;
  452. if (_this._cache == null) {
  453. throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');
  454. }
  455. return _this;
  456. }
  457. CachedResourceLoader.prototype.get = function (url) {
  458. if (this._cache.hasOwnProperty(url)) {
  459. return Promise.resolve(this._cache[url]);
  460. }
  461. else {
  462. return Promise.reject('CachedResourceLoader: Did not find cached template for ' + url);
  463. }
  464. };
  465. return CachedResourceLoader;
  466. }(compiler.ResourceLoader));
  467. /**
  468. * @license
  469. * Copyright Google Inc. All Rights Reserved.
  470. *
  471. * Use of this source code is governed by an MIT-style license that can be
  472. * found in the LICENSE file at https://angular.io/license
  473. */
  474. /**
  475. * @license
  476. * Copyright Google Inc. All Rights Reserved.
  477. *
  478. * Use of this source code is governed by an MIT-style license that can be
  479. * found in the LICENSE file at https://angular.io/license
  480. */
  481. /**
  482. * @publicApi
  483. */
  484. var VERSION = new core.Version('8.1.0');
  485. /**
  486. * @license
  487. * Copyright Google Inc. All Rights Reserved.
  488. *
  489. * Use of this source code is governed by an MIT-style license that can be
  490. * found in the LICENSE file at https://angular.io/license
  491. */
  492. /**
  493. * @publicApi
  494. */
  495. var RESOURCE_CACHE_PROVIDER = [{ provide: compiler.ResourceLoader, useClass: CachedResourceLoader, deps: [] }];
  496. /**
  497. * @publicApi
  498. */
  499. var platformBrowserDynamic = core.createPlatformFactory(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
  500. /**
  501. * @license
  502. * Copyright Google Inc. All Rights Reserved.
  503. *
  504. * Use of this source code is governed by an MIT-style license that can be
  505. * found in the LICENSE file at https://angular.io/license
  506. */
  507. // This file only reexports content of the `src` folder. Keep it that way.
  508. /**
  509. * @license
  510. * Copyright Google Inc. All Rights Reserved.
  511. *
  512. * Use of this source code is governed by an MIT-style license that can be
  513. * found in the LICENSE file at https://angular.io/license
  514. */
  515. /**
  516. * Generated bundle index. Do not edit.
  517. */
  518. exports.ɵangular_packages_platform_browser_dynamic_platform_browser_dynamic_a = CachedResourceLoader;
  519. exports.RESOURCE_CACHE_PROVIDER = RESOURCE_CACHE_PROVIDER;
  520. exports.platformBrowserDynamic = platformBrowserDynamic;
  521. exports.VERSION = VERSION;
  522. exports.JitCompilerFactory = JitCompilerFactory;
  523. exports.ɵCompilerImpl = CompilerImpl;
  524. exports.ɵplatformCoreDynamic = platformCoreDynamic;
  525. exports.ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS;
  526. exports.ɵResourceLoaderImpl = ResourceLoaderImpl;
  527. Object.defineProperty(exports, '__esModule', { value: true });
  528. }));
  529. //# sourceMappingURL=platform-browser-dynamic.umd.js.map