feat(typings): allow defining custom namespace for bundle
Allows declaring a bundle's namespace in generated typings file, which should correspond to the global object representing the module inside its bundle. BREAKING CHANGE The router was previously exported as ng.router in the angular.sfx.dev.js bundle, but now it is exported as ngRouter. Closes #2948 Closes #3544
This commit is contained in:
@ -30,7 +30,7 @@
|
||||
// ***********************************************************
|
||||
{% for alias, module in doc.moduleDocs %}
|
||||
{%- if module.references.length %}
|
||||
// Angular depends transitively on these libraries.
|
||||
// {$ alias $} depends transitively on these libraries.
|
||||
// If you don't have them installed you can install them using TSD
|
||||
// https://github.com/DefinitelyTyped/tsd
|
||||
{%- endif %}
|
||||
@ -39,7 +39,7 @@
|
||||
{% block staticDeclarations %}{% endblock %}
|
||||
{% for alias, module in doc.moduleDocs %}
|
||||
{$ commentBlock(module.doc, 1) $}
|
||||
declare module ng {
|
||||
declare module {$ module.namespace $} {
|
||||
|
||||
{%- for export in module.doc.exports -%}
|
||||
{%- if export.content -%}
|
||||
@ -75,7 +75,7 @@ declare module ng {
|
||||
}
|
||||
|
||||
declare module "{$ alias $}" {
|
||||
export = ng;
|
||||
export = {$ module.namespace $};
|
||||
}
|
||||
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user