# Conflicts: # .nvmrc # aio/content/cli/index.md # aio/content/guide/ajs-quick-reference.md # aio/content/guide/animations.md # aio/content/guide/aot-compiler.md # aio/content/guide/app-shell.md # aio/content/guide/architecture-components.md # aio/content/guide/architecture-modules.md # aio/content/guide/architecture-services.md # aio/content/guide/architecture.md # aio/content/guide/attribute-directives.md # aio/content/guide/bazel.md # aio/content/guide/bootstrapping.md # aio/content/guide/browser-support.md # aio/content/guide/build.md # aio/content/guide/cheatsheet.md # aio/content/guide/cli-builder.md # aio/content/guide/comparing-observables.md # aio/content/guide/complex-animation-sequences.md # aio/content/guide/component-interaction.md # aio/content/guide/component-styles.md # aio/content/guide/creating-libraries.md # aio/content/guide/dependency-injection-in-action.md # aio/content/guide/dependency-injection-navtree.md # aio/content/guide/dependency-injection-providers.md # aio/content/guide/dependency-injection.md # aio/content/guide/deployment.md # aio/content/guide/deprecations.md # aio/content/guide/displaying-data.md # aio/content/guide/dynamic-component-loader.md # aio/content/guide/dynamic-form.md # aio/content/guide/elements.md # aio/content/guide/entry-components.md # aio/content/guide/feature-modules.md # aio/content/guide/file-structure.md # aio/content/guide/form-validation.md # aio/content/guide/forms-overview.md # aio/content/guide/forms.md # aio/content/guide/frequent-ngmodules.md # aio/content/guide/glossary.md # aio/content/guide/hierarchical-dependency-injection.md # aio/content/guide/http.md # aio/content/guide/i18n.md # aio/content/guide/ivy.md # aio/content/guide/language-service.md # aio/content/guide/lazy-loading-ngmodules.md # aio/content/guide/lifecycle-hooks.md # aio/content/guide/module-types.md # aio/content/guide/ngmodule-api.md # aio/content/guide/ngmodule-faq.md # aio/content/guide/ngmodule-vs-jsmodule.md # aio/content/guide/ngmodules.md # aio/content/guide/npm-packages.md # aio/content/guide/observables-in-angular.md # aio/content/guide/observables.md # aio/content/guide/pipes.md # aio/content/guide/providers.md # aio/content/guide/reactive-forms.md # aio/content/guide/releases.md # aio/content/guide/reusable-animations.md # aio/content/guide/route-animations.md # aio/content/guide/router.md # aio/content/guide/rx-library.md # aio/content/guide/schematics-authoring.md # aio/content/guide/schematics-for-libraries.md # aio/content/guide/schematics.md # aio/content/guide/security.md # aio/content/guide/service-worker-communications.md # aio/content/guide/service-worker-config.md # aio/content/guide/service-worker-devops.md # aio/content/guide/service-worker-getting-started.md # aio/content/guide/service-worker-intro.md # aio/content/guide/set-document-title.md # aio/content/guide/setup-local.md # aio/content/guide/sharing-ngmodules.md # aio/content/guide/singleton-services.md # aio/content/guide/static-query-migration.md # aio/content/guide/structural-directives.md # aio/content/guide/styleguide.md # aio/content/guide/template-syntax.md # aio/content/guide/testing.md # aio/content/guide/transition-and-triggers.md # aio/content/guide/typescript-configuration.md # aio/content/guide/universal.md # aio/content/guide/updating.md # aio/content/guide/upgrade-setup.md # aio/content/guide/upgrade.md # aio/content/guide/user-input.md # aio/content/guide/using-libraries.md # aio/content/guide/visual-studio-2015.md # aio/content/guide/web-worker.md # aio/content/guide/workspace-config.md # aio/content/marketing/events.html # aio/content/marketing/resources.json # aio/content/navigation.json # aio/content/start/data.md # aio/content/start/deployment.md # aio/content/start/forms.md # aio/content/start/index.md # aio/content/start/routing.md # aio/content/tutorial/index.md # aio/content/tutorial/toh-pt0.md # aio/content/tutorial/toh-pt1.md # aio/content/tutorial/toh-pt2.md # aio/content/tutorial/toh-pt3.md # aio/content/tutorial/toh-pt4.md # aio/content/tutorial/toh-pt5.md # aio/content/tutorial/toh-pt6.md # aio/package.json # aio/src/app/app.component.spec.ts # aio/src/app/custom-elements/api/api-list.component.html # aio/src/app/layout/doc-viewer/doc-viewer.component.ts # aio/src/app/layout/mode-banner/mode-banner.component.ts # aio/src/app/layout/nav-item/nav-item.component.html # aio/src/app/shared/toc.service.ts # aio/src/styles/0-base/_typography.scss # aio/src/styles/2-modules/_api-pages.scss # aio/tools/transforms/templates/api/lib/memberHelpers.html # aio/yarn.lock # packages/common/http/src/headers.ts # packages/common/http/src/interceptor.ts # packages/common/http/src/params.ts # packages/common/http/src/response.ts # packages/common/src/common_module.ts # packages/common/src/directives/ng_for_of.ts # packages/common/src/location/location.ts # packages/common/src/pipes/date_pipe.ts # packages/core/src/change_detection/pipe_transform.ts # packages/core/src/di/injectable.ts # packages/core/src/metadata/di.ts # packages/core/src/metadata/directives.ts # packages/core/src/metadata/ng_module.ts # packages/core/src/render3/component_ref.ts # packages/forms/src/directives/reactive_directives/form_control_name.ts # packages/forms/src/form_builder.ts # packages/forms/src/model.ts # packages/forms/src/validators.ts # packages/router/src/config.ts # packages/router/src/directives/router_outlet.ts # packages/router/src/events.ts # packages/router/src/router.ts # packages/router/src/router_module.ts # packages/router/src/router_state.ts # packages/router/src/shared.ts
257 lines
10 KiB
HTML
257 lines
10 KiB
HTML
{% import "lib/githubLinks.html" as github -%}
|
|
{% import "lib/paramList.html" as params -%}
|
|
|
|
{%- macro renderHeritage(exportDoc) -%}
|
|
{%- if exportDoc.extendsClauses.length %} extends {% for clause in exportDoc.extendsClauses -%}
|
|
<a class="code-anchor" href="{$ clause.doc.path $}">{$ clause.text $}</a>{% if not loop.last %}, {% endif -%}
|
|
{% endfor %}{% endif %}
|
|
{%- if exportDoc.implementsClauses.length %} implements {% for clause in exportDoc.implementsClauses -%}
|
|
<a class="code-anchor" href="{$ clause.doc.path $}">{$ clause.text $}</a>{% if not loop.last %}, {% endif -%}
|
|
{% endfor %}{% endif %}
|
|
{%- endmacro -%}
|
|
|
|
{%- macro renderMembers(doc) -%}
|
|
{%- for member in doc.staticProperties %}{% if not member.internal %}
|
|
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
{% for member in doc.staticMethods %}{% if not member.internal %}
|
|
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
{% if doc.constructorDoc and not doc.constructorDoc.internal %}
|
|
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ doc.constructorDoc.anchor | urlencode $}">{$ renderMemberSyntax(doc.constructorDoc, 1) $}</a>{% endif -%}
|
|
{% for member in doc.properties %}{% if not member.internal %}
|
|
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
{% for member in doc.methods %}{% if not member.internal %}
|
|
<a class="code-anchor{% if member.deprecated %} deprecated-api-item{% endif %}" href="{$ doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member, 1) $}</a>{% endif %}{% endfor -%}
|
|
|
|
{%- for ancestor in doc.extendsClauses %}{% if ancestor.doc %}
|
|
|
|
// 继承自 <a class="code-anchor" href="{$ ancestor.doc.path $}">{$ ancestor.doc.id $}</a>{$ renderMembers(ancestor.doc) $}{% endif %}{% endfor -%}
|
|
{%- endmacro -%}
|
|
|
|
{%- macro renderMemberSyntax(member, truncateLines) -%}
|
|
{%- if member.boundTo %}<span class="property-binding">@{$ member.boundTo.type $}(
|
|
{%- if member.boundTo.propertyName != member.boundTo.bindingName %}'{$ member.boundTo.bindingName $}'{% endif -%}
|
|
)</span><br>{% endif -%}
|
|
{%- if member.accessibility !== 'public' %}{$ member.accessibility $} {% endif -%}
|
|
{%- if member.isAbstract %}abstract {% endif -%}
|
|
{%- if member.isStatic %}static {% endif -%}
|
|
<span class="member-name">{$ member.name $}</span>{$ member.typeParameters | escape $}{% if not member.isGetAccessor %}{$ params.paramList(member.parameters, truncateLines) | trim $}{% endif %}
|
|
{%- if member.isOptional %}?{% endif -%}
|
|
{$ params.returnType(member.type) | trim | truncateCode(truncateLines) $}
|
|
{%- endmacro -%}
|
|
|
|
{%- macro renderOverloadInfo(overload, cssClass, method) -%}
|
|
<div class="overload-info">
|
|
{% if overload.shortDescription and (overload.shortDescription != method.shortDescription) %}
|
|
<div class="short-description">
|
|
{$ overload.shortDescription | marked $}
|
|
</div>{% endif %}
|
|
|
|
<code-example language="ts" hideCopy="true" class="no-box api-heading{% if overload.deprecated %} deprecated-api-item{% endif %}">{$ renderMemberSyntax(overload) $}</code-example>
|
|
|
|
{% if overload.deprecated !== undefined %}
|
|
<div class="deprecated">
|
|
{$ ('**Deprecated** ' + overload.deprecated) | marked $}
|
|
</div>{% endif %}
|
|
|
|
<h6 class="no-anchor">参数</h6>
|
|
{$ params.renderParameters(overload.parameterDocs, cssClass + '-parameters', cssClass + '-parameter', true) $}
|
|
|
|
{% if overload.type or overload.returns.type %}
|
|
<h6 class="no-anchor">返回值</h6>
|
|
{% marked %}`{$ (overload.type or overload.returns.type) $}`{% if overload.returns %}: {$ overload.returns.description $}{% endif %}{% endmarked %}
|
|
{% endif %}
|
|
|
|
|
|
{% if overload.throws.length %}
|
|
<h6 class="no-anchor">异常</h6>
|
|
{% for error in overload.throws %}
|
|
{% marked %}`{$ (error.typeList or '错误') $}` {$ error.description $}{% endmarked %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if overload.description and (overload.description != method.description) -%}
|
|
<div class="description">
|
|
{$ overload.description | marked $}
|
|
</div>
|
|
{%- endif %}
|
|
</div>
|
|
{%- endmacro -%}
|
|
|
|
{%- macro renderMethodDetail(versionInfo, method, cssClass) -%}
|
|
<a id="{$ method.anchor $}"></a>
|
|
<table class="is-full-width method-table {$ cssClass $}">
|
|
{% if method.name !== 'constructor' %}<thead><tr><th>
|
|
<div class="with-github-links">
|
|
<h3>
|
|
{% if method.isCallMember %}<i>调用签名</i>
|
|
{% elseif method.isNewMember %}<i>构造函数签名</i>
|
|
{% else %}{$ method.name $}()
|
|
{% endif %}
|
|
</h3>
|
|
{$ github.githubLinks(method, versionInfo) $}
|
|
</div>
|
|
</th></tr></thead>{% endif %}
|
|
<tbody>
|
|
{% if method.shortDescription %}<tr>
|
|
<td class="short-description">
|
|
{$ method.shortDescription | marked $}
|
|
{%- if method.see.length %}
|
|
<p>See also:</p>
|
|
<ul>
|
|
{% for see in method.see %}
|
|
<li>{$ see | marked $}</li>{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</td>
|
|
</tr>{% endif %}
|
|
{% if method.overloads.length == 0 %}
|
|
<tr>
|
|
<td>
|
|
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
|
|
</td>
|
|
</tr>
|
|
{% elseif method.overloads.length < 3 -%}
|
|
{% if method.isAbstract %}
|
|
<tr>
|
|
<td>
|
|
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% for overload in method.overloads -%}
|
|
<tr>
|
|
<td>
|
|
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $}
|
|
</td>
|
|
</tr>
|
|
{% endfor -%}
|
|
{% else -%}
|
|
<tr>
|
|
<td>
|
|
<details class="overloads">
|
|
<summary>
|
|
<div class="icon-action-header">
|
|
<h4 class="no-anchor">{$ method.overloads.length $} 个重载形式...</h4>
|
|
<a>
|
|
<span class="show-all">显示所有</span>
|
|
<span class="collapse-all">隐藏所有</span>
|
|
<i class="material-icons expand">expand_more</i>
|
|
</a>
|
|
</div>
|
|
</summary>
|
|
<div class="detail-contents">
|
|
{% if method.isAbstract %}
|
|
{$ renderOverloadInfo(method, cssClass + '-overload', method) $}
|
|
<hr class="hr-margin fullwidth">
|
|
{% endif %}
|
|
{% for overload in method.overloads %}
|
|
<h5 class="no-anchor">Overload #{$ loop.index $}</h5>
|
|
{$ renderOverloadInfo(overload, cssClass + '-overload', method) $}
|
|
{% if not loop.last %}<hr class="hr-margin">{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
</details>
|
|
</td>
|
|
</tr>
|
|
{% endif %}
|
|
|
|
{% if method.description -%}
|
|
<tr>
|
|
<td class="description">
|
|
{$ method.description | marked({ h3: 'h5' }) $}
|
|
</td>
|
|
</tr>
|
|
{%- endif %}
|
|
|
|
{% if method.usageNotes -%}
|
|
<tr>
|
|
<td class="usage-notes">
|
|
<h4 id="{$ method.anchor $}-usage-notes">使用说明</h4>
|
|
{$ method.usageNotes | marked({ h3: 'h5' }) $}
|
|
</td>
|
|
</tr>
|
|
{%- endif %}
|
|
</tbody>
|
|
</table>
|
|
{% endmacro -%}
|
|
|
|
{%- macro renderMethodDetails(versionInfo, methods, containerClass, itemClass, headingText) -%}
|
|
{% set nonInternalMethods = methods | filterByPropertyValue('internal', undefined) %}
|
|
{% if nonInternalMethods.length %}
|
|
<section class="{$ containerClass $}">
|
|
<a name="methods"></a>
|
|
<h2>{$ headingText $}</h2>
|
|
{% for member in nonInternalMethods %}
|
|
{$ renderMethodDetail(versionInfo, member, itemClass) $}
|
|
{% endfor %}
|
|
</section>
|
|
{% endif %}
|
|
{%- endmacro -%}
|
|
|
|
|
|
{%- macro renderProperties(properties, containerClass, propertyClass, headingText, headings, headingLevel = 2) -%}
|
|
{% set nonInternalProperties = properties | filterByPropertyValue('internal', undefined) %}
|
|
{% if nonInternalProperties.length -%}
|
|
<section class="{$ containerClass $}">
|
|
<a name="properties"></a>
|
|
<h{$ headingLevel $}>{$ headingText $}</h{$ headingLevel $}>
|
|
<table class="is-full-width list-table property-table">
|
|
<thead>
|
|
<tr>
|
|
<th>{$ headings[0] or '属性' $}</th>
|
|
<th>{$ headings[1] or '说明' $}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for property in nonInternalProperties %}
|
|
<tr class="{$ propertyClass $}">
|
|
<td>
|
|
<a id="{$ property.anchor $}"></a>
|
|
<code class="{% if property.deprecated %} deprecated-api-item{% endif %}">{$ renderMemberSyntax(property) $}</code>
|
|
</td>
|
|
<td>
|
|
{%- if (property.isGetAccessor or property.isReadonly) and not property.isSetAccessor %}<span class='read-only-property'>只读</span>{% endif %}
|
|
{%- if property.isSetAccessor and not property.isGetAccessor %}<span class='write-only-property'>Write-only.</span>{% endif %}
|
|
{% if property.constructorParamDoc %} <span class='from-constructor'>Declared in constructor.</span>{% endif %}
|
|
{% if property.shortDescription %}{$ property.shortDescription | marked $}{% endif %}
|
|
{$ (property.description or property.constructorParamDoc.description) | marked $}
|
|
{%- if property.see.length %}
|
|
<p>参见:</p>
|
|
<ul>
|
|
{% for see in property.see %}
|
|
<li>{$ see | marked $}</li>{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
{%- endif -%}
|
|
{%- endmacro -%}
|
|
|
|
{% macro renderDirectiveAncestors(doc, collectionName) %}
|
|
{%- for ancestor in doc.extendsClauses %}{% if ancestor.doc %}
|
|
{% set nonInternalMembers = ancestor.doc[collectionName] | filterByPropertyValue('internal', undefined) %}
|
|
{% if nonInternalMembers.length -%}
|
|
<section class="inherited-members-list">
|
|
<h3>继承自 <code><a class="code-anchor" href="{$ ancestor.doc.path $}">{$ ancestor.doc.name $}</a></code></h3>
|
|
<ul>
|
|
{% for member in nonInternalMembers %}
|
|
<li>
|
|
<code><a class="code-anchor" href="{$ ancestor.doc.path $}#{$ member.anchor | urlencode $}">{$ renderMemberSyntax(member) $}</a></code>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</section>
|
|
{% endif %}
|
|
{$ renderDirectiveAncestors(ancestor.doc, collectionName) $}
|
|
{% endif %}{% endfor -%}
|
|
{% endmacro %}
|
|
|
|
{% macro renderDirectiveProperties(doc, heading) %}
|
|
{$ renderProperties(doc.properties, 'instance-properties', 'instance-property', heading) $}
|
|
{$ renderDirectiveAncestors(doc, 'properties') $}
|
|
{% endmacro %}
|