Skip to content

Commit 35312f5

Browse files
committed
Doc improvements
1 parent 3b0223d commit 35312f5

30 files changed

+173
-26
lines changed

@types/angular.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ export class Angular {
122122
* function that will be invoked by the injector as a `config` block.
123123
* See: {@link angular.module modules}
124124
* @param {import("./interface.ts").AngularBootstrapConfig} [config]
125-
* @returns {import('./core/di/internal-injector.js').InjectorService} The created injector instance for this application.
125+
* @returns {ng.InjectorService} The created injector instance for this application.
126126
*/
127127
bootstrap(
128128
element: string | Element | Document,
129129
modules?: Array<string | any>,
130130
config?: import("./interface.ts").AngularBootstrapConfig,
131-
): import("./core/di/internal-injector.js").InjectorService;
131+
): ng.InjectorService;
132132
$rootScope: import("./interface.ts").Scope;
133133
$injector: import("./interface.ts").InjectorService;
134134
/**

@types/interface.d.ts

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export * from "./core/scope/scope.js";
1313
export * from "./services/cookie/cookie.js";
1414
export * from "./services/cookie/interface.ts";
1515
export * from "./services/exception/interface.ts";
16+
export * from "./core/parse/interface.ts";
1617
import { Attributes } from "./core/compile/attributes.js";
1718
import { Scope } from "./core/scope/scope.js";
1819
/**
@@ -67,7 +68,7 @@ export type InjectableClass<TInstance = any> = new (...args: any) => TInstance;
6768
*
6869
* Parentheses are required around constructor types when used in unions.
6970
*/
70-
type FactoryFunction<T> = T extends abstract new (...args: any[]) => any
71+
export type FactoryFunction<T> = T extends abstract new (...args: any[]) => any
7172
? (...args: ConstructorParameters<T>) => InstanceType<T>
7273
: T;
7374
export type Injectable<
@@ -78,6 +79,12 @@ export type Injectable<
7879
? InjectableClass<InstanceType<T>>
7980
: never)
8081
| T;
82+
export interface ServiceProviderClass {
83+
new (...args: any[]): ServiceProvider;
84+
}
85+
export interface ServiceProviderFactory {
86+
(...args: any[]): ServiceProvider;
87+
}
8188
/**
8289
* An object that defines how a service is constructed.
8390
*
@@ -166,6 +173,57 @@ export interface ChangesObject<T = any> {
166173
* Mapping of binding property names to their change metadata.
167174
*/
168175
export type OnChangesObject = Record<string, ChangesObject>;
176+
/**
177+
* Interface for the $onInit lifecycle hook
178+
* https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
179+
*/
180+
export interface OnInit {
181+
/**
182+
* Called on each controller after all the controllers on an element have been constructed and had their bindings
183+
* initialized (and before the pre & post linking functions for the directives on this element). This is a good
184+
* place to put initialization code for your controller.
185+
*/
186+
$onInit(): void;
187+
}
188+
/**
189+
* Interface for the $onChanges lifecycle hook
190+
* https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
191+
*/
192+
export interface OnChanges {
193+
/**
194+
* Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
195+
* properties that have changed, and the values are an {@link IChangesObject} object of the form
196+
* { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
197+
* cloning the bound value to prevent accidental mutation of the outer value.
198+
*/
199+
$onChanges(onChangesObj: OnChangesObject): void;
200+
}
201+
/**
202+
* Interface for the $onDestroy lifecycle hook
203+
* https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
204+
*/
205+
export interface OnDestroy {
206+
/**
207+
* Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
208+
* watches and event handlers.
209+
*/
210+
$onDestroy(): void;
211+
}
212+
/**
213+
* Interface for the $postLink lifecycle hook
214+
* https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
215+
*/
216+
export interface PostLink {
217+
/**
218+
* Called after this controller's element and its children have been linked. Similar to the post-link function this
219+
* hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
220+
* templateUrl directives will not have been compiled and linked since they are waiting for their template to load
221+
* asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
222+
* analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
223+
* different in Angular 1 there is no direct mapping and care should be taken when upgrading.
224+
*/
225+
$postLink(): void;
226+
}
169227
/**
170228
* AngularTS component lifecycle interface.
171229
* Directive controllers have a well-defined lifecycle. Each controller can implement "lifecycle hooks". These are methods that

docs/static/typedoc/assets/hierarchy.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/typedoc/assets/navigation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/typedoc/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/typedoc/classes/CookieService.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CookieService | AngularTS</title><meta name="description" content="Documentation for AngularTS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">AngularTS</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">CookieService</a></li></ul><h1>Class CookieService</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>$cookies service class</p>
2-
<p>Provides high-level APIs for interacting with browser cookies:</p>
1+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>CookieService | AngularTS</title><meta name="description" content="Documentation for AngularTS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">AngularTS</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">CookieService</a></li></ul><h1>Class CookieService</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Provides high-level APIs for interacting with browser cookies:</p>
32
<ul>
43
<li>Raw get/set/remove</li>
54
<li>JSON serialization helpers</li>

docs/static/typedoc/classes/InjectorService.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>InjectorService | AngularTS</title><meta name="description" content="Documentation for AngularTS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">AngularTS</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="" aria-current="page">InjectorService</a></li></ul><h1>Class InjectorService</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Injector for factories and services</p>
2-
</div></section><section class="tsd-panel tsd-hierarchy" data-refl="1244"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">AbstractInjector</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">InjectorService</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
2+
</div></section><section class="tsd-panel tsd-hierarchy" data-refl="1272"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-signature-type">AbstractInjector</span><ul class="tsd-hierarchy"><li class="tsd-hierarchy-item"><span class="tsd-hierarchy-target">InjectorService</span></li></ul></li></ul></section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h5 class="tsd-index-heading uppercase">Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Constructor"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
33
</div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="#cache" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>cache</span></a>
44
<a href="#modules" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>modules</span></a>
55
<a href="#path" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24" aria-label="Property"><use href="../assets/icons.svg#icon-1024"></use></svg><span>path</span></a>

0 commit comments

Comments
 (0)