@angular-wave/angular.ts 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/angular.d.ts +66 -53
- package/@types/animations/animate.d.ts +1 -351
- package/@types/animations/animation.d.ts +2 -2
- package/@types/animations/interface.d.ts +72 -0
- package/@types/animations/{animate-queue.d.ts → queue/animate-queue.d.ts} +2 -7
- package/@types/animations/queue/interface.d.ts +50 -0
- package/@types/animations/raf-scheduler.d.ts +1 -3
- package/@types/core/compile/attributes.d.ts +6 -6
- package/@types/core/compile/compile.d.ts +6 -6
- package/@types/core/controller/controller.d.ts +1 -1
- package/@types/core/di/di.d.ts +26 -0
- package/@types/core/di/injector.d.ts +0 -11
- package/@types/core/di/internal-injector.d.ts +2 -2
- package/@types/core/di/ng-module/ng-module.d.ts +209 -0
- package/@types/core/sanitize/interface.d.ts +8 -0
- package/@types/core/sanitize/sanitize-uri.d.ts +5 -2
- package/@types/core/scope/interface.d.ts +2 -2
- package/@types/core/scope/scope.d.ts +5 -2
- package/@types/directive/bind/bind.d.ts +2 -2
- package/@types/directive/form/form.d.ts +7 -7
- package/@types/directive/if/if.d.ts +2 -2
- package/@types/directive/include/include.d.ts +8 -8
- package/@types/directive/messages/messages.d.ts +18 -22
- package/@types/directive/model/model.d.ts +17 -17
- package/@types/directive/options/options.d.ts +4 -4
- package/@types/directive/scope/scope.d.ts +4 -0
- package/@types/directive/show-hide/show-hide.d.ts +3 -4
- package/@types/directive/switch/switch.d.ts +3 -5
- package/@types/directive/wasm/wasm.d.ts +4 -0
- package/@types/{services → directive}/worker/interface.d.ts +1 -0
- package/@types/directive/worker/worker.d.ts +18 -8
- package/@types/interface.d.ts +76 -15
- package/@types/namespace.d.ts +49 -6
- package/@types/router/url/url-service.d.ts +1 -4
- package/@types/services/cookie/cookie.d.ts +78 -0
- package/@types/services/cookie/interface.d.ts +12 -0
- package/@types/services/exception/exception.d.ts +56 -0
- package/@types/services/exception/interface.d.ts +2 -3
- package/@types/services/log/log.d.ts +2 -2
- package/@types/services/rest/interface.d.ts +17 -0
- package/@types/services/rest/rest.d.ts +110 -0
- package/@types/services/rest/rfc.d.ts +40 -0
- package/@types/services/sce/sce.d.ts +4 -82
- package/@types/services/sse/sse.d.ts +1 -5
- package/@types/services/storage/interface.d.ts +6 -0
- package/@types/services/storage/storage.d.ts +19 -0
- package/@types/services/stream/interface.d.ts +18 -0
- package/@types/shared/dom.d.ts +27 -14
- package/@types/shared/strings.d.ts +0 -6
- package/@types/shared/utils.d.ts +27 -14
- package/README.md +3 -90
- package/dist/angular-ts.esm.js +2539 -1542
- package/dist/angular-ts.umd.js +2539 -1542
- package/dist/angular-ts.umd.min.js +1 -1
- package/package.json +1 -1
- package/@types/core/di/ng-module.d.ts +0 -156
- package/@types/services/exception/exception-handler.d.ts +0 -58
- package/@types/services/worker/worker.d.ts +0 -31
|
@@ -24,85 +24,7 @@ export namespace SCE_CONTEXTS {
|
|
|
24
24
|
* `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
|
|
25
25
|
* Contextual Escaping (SCE)} services to AngularTS.
|
|
26
26
|
*
|
|
27
|
-
* For an overview of this service and the
|
|
28
|
-
* page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how
|
|
29
|
-
* SCE works in their application, which shouldn't be needed in most cases.
|
|
30
|
-
*
|
|
31
|
-
* <div class="alert alert-danger">
|
|
32
|
-
* AngularTS strongly relies on contextual escaping for the security of bindings: disabling or
|
|
33
|
-
* modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners,
|
|
34
|
-
* changes to this service will also influence users, so be extra careful and document your changes.
|
|
35
|
-
* </div>
|
|
36
|
-
*
|
|
37
|
-
* Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of
|
|
38
|
-
* the `$sce` service to customize the way Strict Contextual Escaping works in AngularTS. This is
|
|
39
|
-
* because, while the `$sce` provides numerous shorthand methods, etc., you really only need to
|
|
40
|
-
* override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things
|
|
41
|
-
* work because `$sce` delegates to `$sceDelegate` for these operations.
|
|
42
|
-
*
|
|
43
|
-
* Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.
|
|
44
|
-
*
|
|
45
|
-
* The default instance of `$sceDelegate` should work out of the box with little pain. While you
|
|
46
|
-
* can override it completely to change the behavior of `$sce`, the common case would
|
|
47
|
-
* involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting
|
|
48
|
-
* your own trusted and banned resource lists for trusting URLs used for loading AngularTS resources
|
|
49
|
-
* such as templates. Refer {@link ng.$sceDelegateProvider#trustedResourceUrlList
|
|
50
|
-
* $sceDelegateProvider.trustedResourceUrlList} and {@link
|
|
51
|
-
* ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList}
|
|
52
|
-
*/
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate
|
|
56
|
-
* $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}.
|
|
57
|
-
*
|
|
58
|
-
* The `$sceDelegateProvider` allows one to get/set the `trustedResourceUrlList` and
|
|
59
|
-
* `bannedResourceUrlList` used to ensure that the URLs used for sourcing AngularTS templates and
|
|
60
|
-
* other script-running URLs are safe (all places that use the `$sce.RESOURCE_URL` context). See
|
|
61
|
-
* {@link ng.$sceDelegateProvider#trustedResourceUrlList
|
|
62
|
-
* $sceDelegateProvider.trustedResourceUrlList} and
|
|
63
|
-
* {@link ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList},
|
|
64
|
-
*
|
|
65
|
-
* For the general details about this service in AngularTS, read the main page for {@link ng.$sce
|
|
66
|
-
* Strict Contextual Escaping (SCE)}.
|
|
67
|
-
*
|
|
68
|
-
* **Example**: Consider the following case. <a name="example"></a>
|
|
69
|
-
*
|
|
70
|
-
* - your app is hosted at url `http://myapp.example.com/`
|
|
71
|
-
* - but some of your templates are hosted on other domains you control such as
|
|
72
|
-
* `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc.
|
|
73
|
-
* - and you have an open redirect at `http://myapp.example.com/clickThru?...`.
|
|
74
|
-
*
|
|
75
|
-
* Here is what a secure configuration for this scenario might look like:
|
|
76
|
-
*
|
|
77
|
-
* ```
|
|
78
|
-
* angular.module('myApp', []).config(function($sceDelegateProvider) {
|
|
79
|
-
* $sceDelegateProvider.trustedResourceUrlList([
|
|
80
|
-
* // Allow same origin resource loads.
|
|
81
|
-
* 'self',
|
|
82
|
-
* // Allow loading from our assets domain. Notice the difference between * and **.
|
|
83
|
-
* 'http://srv*.assets.example.com/**'
|
|
84
|
-
* ]);
|
|
85
|
-
*
|
|
86
|
-
* // The banned resource URL list overrides the trusted resource URL list so the open redirect
|
|
87
|
-
* // here is blocked.
|
|
88
|
-
* $sceDelegateProvider.bannedResourceUrlList([
|
|
89
|
-
* 'http://myapp.example.com/clickThru**'
|
|
90
|
-
* ]);
|
|
91
|
-
* });
|
|
92
|
-
* ```
|
|
93
|
-
* Note that an empty trusted resource URL list will block every resource URL from being loaded, and will require
|
|
94
|
-
* you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates
|
|
95
|
-
* requested by {@link ng.$templateRequest $templateRequest} that are present in
|
|
96
|
-
* {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism
|
|
97
|
-
* to populate your templates in that cache at config time, then it is a good idea to remove 'self'
|
|
98
|
-
* from the trusted resource URL lsit. This helps to mitigate the security impact of certain types
|
|
99
|
-
* of issues, like for instance attacker-controlled `ng-includes`.
|
|
100
|
-
*/
|
|
101
|
-
/**
|
|
102
|
-
* `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
|
|
103
|
-
* Contextual Escaping (SCE)} services to AngularTS.
|
|
104
|
-
*
|
|
105
|
-
* For an overview of this service and the functionnality it provides in AngularTS, see the main
|
|
27
|
+
* For an overview of this service and the functionality it provides in AngularTS, see the main
|
|
106
28
|
* page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how
|
|
107
29
|
* SCE works in their application, which shouldn't be needed in most cases.
|
|
108
30
|
*
|
|
@@ -179,7 +101,7 @@ export namespace SCE_CONTEXTS {
|
|
|
179
101
|
export class SceDelegateProvider {
|
|
180
102
|
/**
|
|
181
103
|
*
|
|
182
|
-
* @param {Array=}
|
|
104
|
+
* @param {Array=} value When provided, replaces the trustedResourceUrlList with
|
|
183
105
|
* the value provided. This must be an array or null. A snapshot of this array is used so
|
|
184
106
|
* further changes to the array are ignored.
|
|
185
107
|
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
|
|
@@ -198,7 +120,7 @@ export class SceDelegateProvider {
|
|
|
198
120
|
* its origin with other apps! It is a good idea to limit it to only your application's directory.
|
|
199
121
|
* </div>
|
|
200
122
|
*/
|
|
201
|
-
trustedResourceUrlList: (value
|
|
123
|
+
trustedResourceUrlList: (value?: any[] | undefined, ...args: any[]) => any[];
|
|
202
124
|
/**
|
|
203
125
|
*
|
|
204
126
|
* @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with
|
|
@@ -226,7 +148,7 @@ export class SceDelegateProvider {
|
|
|
226
148
|
| string
|
|
227
149
|
| ((
|
|
228
150
|
$injector: ng.InjectorService,
|
|
229
|
-
$$sanitizeUri:
|
|
151
|
+
$$sanitizeUri: import("../../core/sanitize/interface.ts").SanitizerFn,
|
|
230
152
|
$exceptionHandler: ng.ExceptionHandlerService,
|
|
231
153
|
) => {
|
|
232
154
|
trustAs: (type: string, trustedValue: any) => any;
|
|
@@ -17,11 +17,7 @@ export class SseProvider {
|
|
|
17
17
|
* @type {ng.SseConfig}
|
|
18
18
|
*/
|
|
19
19
|
defaults: ng.SseConfig;
|
|
20
|
-
|
|
21
|
-
* Returns the $sse service function
|
|
22
|
-
* @returns {ng.SseService}
|
|
23
|
-
*/
|
|
24
|
-
$get: any[];
|
|
20
|
+
$get: (string | ((log: ng.LogService) => ng.SseService))[];
|
|
25
21
|
$log: import("../log/interface.ts").LogService;
|
|
26
22
|
#private;
|
|
27
23
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a proxy that automatically persists an object's state
|
|
3
|
+
* into a storage backend whenever a property is set.
|
|
4
|
+
*
|
|
5
|
+
* @param {object} target - The object to wrap
|
|
6
|
+
* @param {string} key - The storage key
|
|
7
|
+
* @param {object} storage - Any storage-like object with getItem/setItem/removeItem
|
|
8
|
+
* @param {{serialize?: function, deserialize?: function}} [options] - Optional custom (de)serialization
|
|
9
|
+
* @returns {Proxy}
|
|
10
|
+
*/
|
|
11
|
+
export function createPersistentProxy(
|
|
12
|
+
target: object,
|
|
13
|
+
key: string,
|
|
14
|
+
storage: object,
|
|
15
|
+
options?: {
|
|
16
|
+
serialize?: Function;
|
|
17
|
+
deserialize?: Function;
|
|
18
|
+
},
|
|
19
|
+
): ProxyConstructor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface StreamConnectionConfig {
|
|
2
|
+
/** Called when the connection opens */
|
|
3
|
+
onOpen?: (event: Event) => void;
|
|
4
|
+
/** Called when a message is received */
|
|
5
|
+
onMessage?: (data: any, event: Event) => void;
|
|
6
|
+
/** Called when an error occurs */
|
|
7
|
+
onError?: (err: any) => void;
|
|
8
|
+
/** Called when a reconnect attempt happens */
|
|
9
|
+
onReconnect?: (attempt: number) => void;
|
|
10
|
+
/** Delay between reconnect attempts in milliseconds */
|
|
11
|
+
retryDelay?: number;
|
|
12
|
+
/** Maximum number of reconnect attempts */
|
|
13
|
+
maxRetries?: number;
|
|
14
|
+
/** Timeout in milliseconds to detect heartbeat inactivity */
|
|
15
|
+
heartbeatTimeout?: number;
|
|
16
|
+
/** Function to transform incoming messages */
|
|
17
|
+
transformMessage?: (data: any) => any;
|
|
18
|
+
}
|
package/@types/shared/dom.d.ts
CHANGED
|
@@ -99,18 +99,18 @@ export function deleteCacheData(element: Element, key: string): void;
|
|
|
99
99
|
* Gets scope for a given element.
|
|
100
100
|
*
|
|
101
101
|
* @param {Element} element - The DOM element to get data from.
|
|
102
|
-
* @returns {
|
|
102
|
+
* @returns {ng.Scope} - The retrieved data for the given key or all data if no key is provided.
|
|
103
103
|
*/
|
|
104
|
-
export function getScope(element: Element):
|
|
104
|
+
export function getScope(element: Element): ng.Scope;
|
|
105
105
|
/**
|
|
106
106
|
* Set scope for a given element.
|
|
107
107
|
*
|
|
108
108
|
* @param {Element|Node|ChildNode} element - The DOM element to set data on.
|
|
109
|
-
* @param {
|
|
109
|
+
* @param {ng.Scope} scope - The Scope attached to this element
|
|
110
110
|
*/
|
|
111
111
|
export function setScope(
|
|
112
112
|
element: Element | Node | ChildNode,
|
|
113
|
-
scope:
|
|
113
|
+
scope: ng.Scope,
|
|
114
114
|
): void;
|
|
115
115
|
/**
|
|
116
116
|
* Gets isolate scope for a given element.
|
|
@@ -123,23 +123,20 @@ export function getIsolateScope(element: Element): any;
|
|
|
123
123
|
* Set isolate scope for a given element.
|
|
124
124
|
*
|
|
125
125
|
* @param {Element} element - The DOM element to set data on.
|
|
126
|
-
* @param {
|
|
126
|
+
* @param {ng.Scope} scope - The Scope attached to this element
|
|
127
127
|
*/
|
|
128
|
-
export function setIsolateScope(
|
|
129
|
-
element: Element,
|
|
130
|
-
scope: import("../core/scope/scope.js").Scope,
|
|
131
|
-
): void;
|
|
128
|
+
export function setIsolateScope(element: Element, scope: ng.Scope): void;
|
|
132
129
|
/**
|
|
133
130
|
* Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"
|
|
134
131
|
*
|
|
135
132
|
* @param {Element} element - The DOM element to get data from.
|
|
136
133
|
* @param {string} [name] - Controller name.
|
|
137
|
-
* @returns {
|
|
134
|
+
* @returns {ng.Scope|undefined} - The retrieved data
|
|
138
135
|
*/
|
|
139
136
|
export function getController(
|
|
140
137
|
element: Element,
|
|
141
138
|
name?: string,
|
|
142
|
-
):
|
|
139
|
+
): ng.Scope | undefined;
|
|
143
140
|
/**
|
|
144
141
|
*
|
|
145
142
|
* @param {Node} element
|
|
@@ -233,10 +230,26 @@ export function emptyElement(element: Element): void;
|
|
|
233
230
|
* @returns {boolean}
|
|
234
231
|
*/
|
|
235
232
|
export function isRoot(element: Element): boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Inserts a DOM element before or at the beginning of a parent element.
|
|
235
|
+
*
|
|
236
|
+
* @param {HTMLElement | Element} element
|
|
237
|
+
* The element to insert into the DOM.
|
|
238
|
+
*
|
|
239
|
+
* @param {HTMLElement | Element} parentElement
|
|
240
|
+
* The parent element that will receive the inserted element.
|
|
241
|
+
*
|
|
242
|
+
* @param {HTMLElement | Element | null} [afterElement]
|
|
243
|
+
* An optional sibling element — if present and valid, `element`
|
|
244
|
+
* will be inserted after it. If omitted or invalid, `element`
|
|
245
|
+
* is prepended to `parentElement`.
|
|
246
|
+
*
|
|
247
|
+
* @returns {void}
|
|
248
|
+
*/
|
|
236
249
|
export function domInsert(
|
|
237
|
-
element:
|
|
238
|
-
parentElement:
|
|
239
|
-
afterElement
|
|
250
|
+
element: HTMLElement | Element,
|
|
251
|
+
parentElement: HTMLElement | Element,
|
|
252
|
+
afterElement?: HTMLElement | Element | null,
|
|
240
253
|
): void;
|
|
241
254
|
export function animatedomInsert(element: any, parent: any, after: any): void;
|
|
242
255
|
/**
|
|
@@ -49,10 +49,4 @@ export function splitOnDelim(delim: any): (str: any) => any;
|
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
51
|
export function joinNeighborsR(acc: any, x: any): any;
|
|
52
|
-
export function beforeAfterSubstr(char: any): (str: any) => any[];
|
|
53
|
-
export const hostRegex: RegExp;
|
|
54
52
|
export function stripLastPathElement(str: any): any;
|
|
55
|
-
export function splitHash(str: any): any[];
|
|
56
|
-
export function splitQuery(str: any): any[];
|
|
57
|
-
export function splitEqual(str: any): any[];
|
|
58
|
-
export function trimHashVal(str: any): any;
|
package/@types/shared/utils.d.ts
CHANGED
|
@@ -208,19 +208,6 @@ export function isNumberNaN(num: any): boolean;
|
|
|
208
208
|
*/
|
|
209
209
|
export function inherit(parent: any, extra: any): any;
|
|
210
210
|
export function hasCustomToString(obj: any): boolean;
|
|
211
|
-
/**
|
|
212
|
-
* @module angular
|
|
213
|
-
* @function isElement
|
|
214
|
-
|
|
215
|
-
* @function
|
|
216
|
-
*
|
|
217
|
-
* @description
|
|
218
|
-
* Determines if a reference is a DOM element (or wrapped jQuery element).
|
|
219
|
-
*
|
|
220
|
-
* @param {*} node Reference to check.
|
|
221
|
-
* @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
|
|
222
|
-
*/
|
|
223
|
-
export function isElement(node: any): boolean;
|
|
224
211
|
/**
|
|
225
212
|
* Returns a string appropriate for the type of node.
|
|
226
213
|
*
|
|
@@ -488,7 +475,18 @@ export function toDebugString(obj: any): any;
|
|
|
488
475
|
* The resulting string key is in 'type:hashKey' format.
|
|
489
476
|
*/
|
|
490
477
|
export function hashKey(obj: any): string;
|
|
491
|
-
|
|
478
|
+
/**
|
|
479
|
+
* Merges two class name values into a single space-separated string.
|
|
480
|
+
* Accepts strings, arrays of strings, or null/undefined values.
|
|
481
|
+
*
|
|
482
|
+
* @param {string | string[] | null | undefined} a - The first class name(s).
|
|
483
|
+
* @param {string | string[] | null | undefined} b - The second class name(s).
|
|
484
|
+
* @returns {string} A single string containing all class names separated by spaces.
|
|
485
|
+
*/
|
|
486
|
+
export function mergeClasses(
|
|
487
|
+
a: string | string[] | null | undefined,
|
|
488
|
+
b: string | string[] | null | undefined,
|
|
489
|
+
): string;
|
|
492
490
|
/**
|
|
493
491
|
* Converts all accepted directives format into proper directive name.
|
|
494
492
|
* @param {string} name Name to normalize
|
|
@@ -571,5 +569,20 @@ export function wait(t?: number): Promise<void>;
|
|
|
571
569
|
* // returns false
|
|
572
570
|
*/
|
|
573
571
|
export function startsWith(str: string, search: string): boolean;
|
|
572
|
+
/**
|
|
573
|
+
* Loads and instantiates a WebAssembly module.
|
|
574
|
+
* Tries streaming first, then falls back.
|
|
575
|
+
*/
|
|
576
|
+
export function instantiateWasm(
|
|
577
|
+
src: any,
|
|
578
|
+
imports?: {},
|
|
579
|
+
): Promise<{
|
|
580
|
+
instance: WebAssembly.Instance;
|
|
581
|
+
exports: WebAssembly.Exports;
|
|
582
|
+
module: WebAssembly.Module;
|
|
583
|
+
}>;
|
|
574
584
|
export const isProxySymbol: unique symbol;
|
|
585
|
+
export const BADARG: "badarg";
|
|
586
|
+
export const BADARGKEY: "badarg: key";
|
|
587
|
+
export const BADARGVALUE: "badarg: value";
|
|
575
588
|
export const ngAttrPrefixes: string[];
|
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ AngularTS adds:
|
|
|
16
16
|
- built-in enterprise-level router (`ui-router` ported as `ng-router`)
|
|
17
17
|
- built-in animations (`animate`)
|
|
18
18
|
- new directives, inspired by `HTMX`
|
|
19
|
+
- new injectables for REST resources, persistent stores, Web Workers and WASM modules
|
|
19
20
|
|
|
20
21
|
The result is a high-performance, buildless, progressive and battle-tested JS framework that stays as close to Web standards as possible.
|
|
21
22
|
If you write server-rendered web applications for desktop and mobile, and do not wish to leave the comfort of your tech-stack, this is your new secret weapon.
|
|
@@ -43,97 +44,9 @@ Initialize your app
|
|
|
43
44
|
<div ng-app ng-init="x='world'">Hello {{ x }}</div>
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
Or check out the updated [Angular seed](https://github.com/angular-
|
|
47
|
+
Or check out the updated [Angular seed](https://github.com/angular-wave/angular-seed), which can serve as a solid starting point
|
|
47
48
|
or a source of inspiration for new ideas.
|
|
48
49
|
|
|
49
|
-
New docs website is coming!
|
|
50
|
-
|
|
51
|
-
### Legacy docs
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
- Web site: https://angularjs.org
|
|
56
|
-
- Tutorial: https://docs.angularjs.org/tutorial
|
|
57
|
-
- API Docs: https://docs.angularjs.org/api
|
|
58
|
-
- Developer Guide: https://docs.angularjs.org/guide
|
|
59
|
-
- Contribution guidelines: [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
60
|
-
- Core Development: [DEVELOPERS.md](DEVELOPERS.md)
|
|
61
|
-
- Dashboard: https://dashboard.angularjs.org
|
|
62
|
-
|
|
63
50
|
## Documentation
|
|
64
51
|
|
|
65
|
-
Go to https://
|
|
66
|
-
|
|
67
|
-
## Contribute
|
|
68
|
-
|
|
69
|
-
We've set up a separate document for our
|
|
70
|
-
[contribution guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md).
|
|
71
|
-
|
|
72
|
-
## Develop
|
|
73
|
-
|
|
74
|
-
We've set up a separate document for
|
|
75
|
-
[developers](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md).
|
|
76
|
-
|
|
77
|
-
## What to use AngularTS for and when to use it
|
|
78
|
-
|
|
79
|
-
AngularTS is the next generation framework where each component is designed to work with every other
|
|
80
|
-
component in an interconnected way like a well-oiled machine. AngularTS is JavaScript MVC made easy
|
|
81
|
-
and done right. (Well it is not really MVC, read on, to understand what this means.)
|
|
82
|
-
|
|
83
|
-
#### MVC, no, MV\* done the right way!
|
|
84
|
-
|
|
85
|
-
[MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller), short for
|
|
86
|
-
Model-View-Controller, is a design pattern, i.e. how the code should be organized and how the
|
|
87
|
-
different parts of an application separated for proper readability and debugging. Model is the data
|
|
88
|
-
and the database. View is the user interface and what the user sees. Controller is the main link
|
|
89
|
-
between Model and View. These are the three pillars of major programming frameworks present on the
|
|
90
|
-
market today. On the other hand AngularTS works on MV\*, short for Model-View-_Whatever_. The
|
|
91
|
-
_Whatever_ is AngularTS's way of telling that you may create any kind of linking between the Model
|
|
92
|
-
and the View here.
|
|
93
|
-
|
|
94
|
-
Unlike other frameworks in any programming language, where MVC, the three separate components, each
|
|
95
|
-
one has to be written and then connected by the programmer, AngularTS helps the programmer by asking
|
|
96
|
-
him/her to just create these and everything else will be taken care of by AngularTS.
|
|
97
|
-
|
|
98
|
-
#### Interconnection with HTML at the root level
|
|
99
|
-
|
|
100
|
-
AngularTS uses HTML to define the user's interface. AngularTS also enables the programmer to write
|
|
101
|
-
new HTML tags (AngularTS Directives) and increase the readability and understandability of the HTML
|
|
102
|
-
code. Directives are AngularTS’s way of bringing additional functionality to HTML. Directives
|
|
103
|
-
achieve this by enabling us to invent our own HTML elements. This also helps in making the code DRY
|
|
104
|
-
(Don't Repeat Yourself), which means once created, a new directive can be used anywhere within the
|
|
105
|
-
application.
|
|
106
|
-
|
|
107
|
-
HTML is also used to determine the wiring of the app. Special attributes in the HTML determine where
|
|
108
|
-
to load the app, which components or controllers to use for each element, etc. We specify "what"
|
|
109
|
-
gets loaded, but not "how". This declarative approach greatly simplifies app development in a sort
|
|
110
|
-
of WYSIWYG way. Rather than spending time on how the program flows and orchestrating the various
|
|
111
|
-
moving parts, we simply define what we want and AngularTS will take care of the dependencies.
|
|
112
|
-
|
|
113
|
-
#### Data Handling made simple
|
|
114
|
-
|
|
115
|
-
Data and Data Models in AngularTS are plain JavaScript objects and one can add and change properties
|
|
116
|
-
directly on it and loop over objects and arrays at will.
|
|
117
|
-
|
|
118
|
-
#### Two-way Data Binding
|
|
119
|
-
|
|
120
|
-
One of AngularTS's strongest features. Two-way Data Binding means that if something changes in the
|
|
121
|
-
Model, the change gets reflected in the View instantaneously, and the same happens the other way
|
|
122
|
-
around. This is also referred to as Reactive Programming, i.e. suppose `a = b + c` is being
|
|
123
|
-
programmed and after this, if the value of `b` and/or `c` is changed then the value of `a` will be
|
|
124
|
-
automatically updated to reflect the change. AngularTS uses its "scopes" as a glue between the Model
|
|
125
|
-
and View and makes these updates in one available for the other.
|
|
126
|
-
|
|
127
|
-
#### Less Written Code and Easily Maintainable Code
|
|
128
|
-
|
|
129
|
-
Everything in AngularTS is created to enable the programmer to end up writing less code that is
|
|
130
|
-
easily maintainable and readable by any other new person on the team. Believe it or not, one can
|
|
131
|
-
write a complete working two-way data binded application in less than 10 lines of code. Try and see
|
|
132
|
-
for yourself!
|
|
133
|
-
|
|
134
|
-
#### Testing Ready
|
|
135
|
-
|
|
136
|
-
AngularTS has Dependency Injection, i.e. it takes care of providing all the necessary dependencies
|
|
137
|
-
to its controllers and services whenever required. This helps in making the AngularTS code ready for
|
|
138
|
-
unit testing by making use of mock dependencies created and injected. This makes AngularTS more
|
|
139
|
-
modular and easily testable thus in turn helping a team create more robust applications.
|
|
52
|
+
Go to https://angular-wave.github.io/angular.ts/
|