@angular-wave/angular.ts 0.7.3 → 0.7.5
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/.prettierignore +2 -1
- package/@types/core/exception-handler.d.ts +2 -2
- package/@types/core/task-tracker-factory.d.ts +2 -2
- package/@types/directive/channel/channel.d.ts +2 -18
- package/@types/directive/http/http.d.ts +3 -0
- package/@types/directive/script/script.d.ts +2 -2
- package/@types/directive/setter/setter.d.ts +2 -2
- package/@types/injection-tokens.d.ts +3 -0
- package/@types/interface.d.ts +11 -0
- package/@types/loader.d.ts +3 -4
- package/@types/router/params/param-factory.d.ts +10 -2
- package/@types/router/params/param.d.ts +22 -3
- package/@types/router/template-factory.d.ts +2 -2
- package/@types/router/url/url-service.d.ts +2 -2
- package/@types/services/http/http.d.ts +2 -2
- package/@types/services/http/interface.d.ts +219 -0
- package/@types/services/http-backend/http-backend.d.ts +26 -19
- package/@types/services/log/interface.d.ts +33 -0
- package/@types/services/log/log.d.ts +25 -0
- package/@types/{core → services}/pubsub/pubsub.d.ts +6 -6
- package/@types/services/template-cache/interface.d.ts +4 -0
- package/@types/services/template-cache/template-cache.d.ts +11 -0
- package/@types/services/template-request.d.ts +1 -1
- package/@types/shared/cache.d.ts +9 -0
- package/@types/shared/dom.d.ts +2 -2
- package/Makefile +2 -2
- package/dist/angular-ts.esm.js +168 -165
- package/dist/angular-ts.umd.js +168 -165
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/assets/scss/_variables_project.scss +1 -1
- package/docs/assets/scss/_variables_project_after_bs.scss +5 -5
- package/docs/assets/scss/index.scss +2 -3
- package/docs/content/_index.md +1 -1
- package/docs/content/docs/_index.md +59 -25
- package/docs/content/docs/directive/_index.md +4 -0
- package/docs/content/docs/directive/app.md +11 -0
- package/docs/content/docs/directive/aria.md +0 -0
- package/docs/content/docs/directive/blur.md +38 -0
- package/docs/content/docs/directive/channel.md +37 -0
- package/docs/content/docs/directive/class-even.md +47 -0
- package/docs/content/docs/directive/class-odd.md +48 -0
- package/docs/content/docs/directive/class.md +64 -0
- package/docs/content/docs/directive/click.md +38 -0
- package/docs/content/docs/directive/cloak.md +74 -0
- package/docs/content/docs/directive/copy.md +38 -0
- package/docs/content/docs/directive/cut.md +40 -0
- package/docs/content/docs/directive/dblclick.md +38 -0
- package/docs/content/docs/directive/focus.md +38 -0
- package/docs/content/docs/directive/include.md +7 -0
- package/docs/content/docs/directive/keydown.md +0 -0
- package/docs/content/docs/directive/keyup.md +0 -0
- package/docs/content/docs/directive/load.md +0 -0
- package/docs/content/docs/directive/mousedown.md +38 -0
- package/docs/content/docs/directive/mouseenter.md +38 -0
- package/docs/content/docs/directive/mouseleave.md +38 -0
- package/docs/content/docs/directive/mousemove.md +38 -0
- package/docs/content/docs/directive/mouseout.md +38 -0
- package/docs/content/docs/directive/mouseover.md +38 -0
- package/docs/content/docs/directive/mouseup.md +38 -0
- package/docs/content/docs/filter/_index.md +4 -0
- package/docs/content/docs/provider/_index.md +4 -0
- package/docs/content/docs/provider/eventBusProvider.md +35 -0
- package/docs/content/docs/provider/logProvider.md +59 -0
- package/docs/content/docs/provider/templateCacheProvider.md +35 -0
- package/docs/content/docs/service/_index.md +4 -0
- package/docs/content/docs/service/eventBus.md +56 -0
- package/docs/content/docs/service/log.md +113 -0
- package/docs/content/docs/service/templateCache.md +64 -0
- package/docs/hugo.yaml +3 -3
- package/docs/layouts/404.html +1 -1
- package/docs/layouts/partials/hooks/head-end.html +3 -0
- package/docs/layouts/shortcodes/showhtml.html +2 -0
- package/docs/layouts/shortcodes/showjs.html +2 -0
- package/docs/layouts/shortcodes/showraw.html +1 -0
- package/docs/static/examples/counter/counter-test.html +17 -0
- package/docs/static/examples/counter/counter.html +5 -0
- package/docs/static/examples/counter/counter.test.js +28 -0
- package/docs/static/examples/eventbus/eventbus-test.html +19 -0
- package/docs/static/examples/eventbus/eventbus.html +13 -0
- package/docs/static/examples/eventbus/eventbus.js +15 -0
- package/docs/static/examples/eventbus/eventbus.test.js +19 -0
- package/docs/static/examples/ng-blur/ng-blur.html +9 -0
- package/docs/static/examples/ng-channel/ng-channel-test.html +17 -0
- package/docs/static/examples/ng-channel/ng-channel.html +24 -0
- package/docs/static/examples/ng-channel/ng-channel.test.js +31 -0
- package/docs/static/examples/ng-class/ng-class.html +71 -0
- package/docs/static/examples/ng-class-even/ng-class-even.html +8 -0
- package/docs/static/examples/ng-class-odd/ng-class-odd.html +8 -0
- package/docs/static/examples/ng-click/ng-click.html +6 -0
- package/docs/static/examples/ng-copy/ng-copy.html +6 -0
- package/docs/static/examples/ng-cut/ng-cut.html +6 -0
- package/docs/static/examples/ng-dblclick/ng-dblclick.html +10 -0
- package/docs/static/examples/ng-focus/ng-focus.html +9 -0
- package/docs/static/examples/ng-mousedown/ng-mousedown.html +6 -0
- package/docs/static/examples/ng-mouseenter/ng-mouseenter.html +4 -0
- package/docs/static/examples/ng-mouseleave/ng-mouseleave.html +4 -0
- package/docs/static/examples/ng-mousemove/ng-mousemove.html +4 -0
- package/docs/static/examples/ng-mouseout/ng-mouseout.html +4 -0
- package/docs/static/examples/ng-mouseover/ng-mouseover.html +4 -0
- package/docs/static/examples/ng-mouseup/ng-mouseup.html +4 -0
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/classes/LogProvider.html +6 -0
- package/docs/static/typedoc/classes/PubSub.html +71 -0
- package/docs/static/typedoc/classes/PubSubProvider.html +3 -0
- package/docs/static/typedoc/classes/TemplateCacheProvider.html +5 -0
- package/docs/static/typedoc/hierarchy.html +1 -1
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/ChangesObject.html +1 -1
- package/docs/static/typedoc/interfaces/ComponentOptions.html +1 -1
- package/docs/static/typedoc/interfaces/Controller.html +1 -1
- package/docs/static/typedoc/interfaces/Directive.html +1 -1
- package/docs/static/typedoc/interfaces/DirectivePrePost.html +1 -1
- package/docs/static/typedoc/interfaces/HttpHeadersGetter.html +1 -0
- package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +31 -0
- package/docs/static/typedoc/interfaces/HttpRequestConfigHeaders.html +6 -0
- package/docs/static/typedoc/interfaces/HttpRequestTransformer.html +1 -0
- package/docs/static/typedoc/interfaces/HttpResponse.html +8 -0
- package/docs/static/typedoc/interfaces/HttpResponseTransformer.html +1 -0
- package/docs/static/typedoc/interfaces/HttpService.html +38 -0
- package/docs/static/typedoc/interfaces/LogService.html +12 -0
- package/docs/static/typedoc/interfaces/NgModelController.html +1 -1
- package/docs/static/typedoc/interfaces/NgModelOptions.html +1 -1
- package/docs/static/typedoc/interfaces/Provider.html +1 -1
- package/docs/static/typedoc/interfaces/RequestConfig.html +48 -0
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +38 -0
- package/docs/static/typedoc/interfaces/ServiceProvider.html +1 -1
- package/docs/static/typedoc/interfaces/TranscludeFunctionObject.html +1 -1
- package/docs/static/typedoc/types/AnnotatedFactory.html +1 -1
- package/docs/static/typedoc/types/CloneAttachFunction.html +1 -1
- package/docs/static/typedoc/types/ControllerConstructor.html +1 -1
- package/docs/static/typedoc/types/DirectiveCompileFn.html +1 -1
- package/docs/static/typedoc/types/DirectiveController.html +1 -1
- package/docs/static/typedoc/types/DirectiveFactory.html +1 -1
- package/docs/static/typedoc/types/DirectiveLinkFn.html +1 -1
- package/docs/static/typedoc/types/ExpandoStore.html +2 -0
- package/docs/static/typedoc/types/Expression.html +1 -1
- package/docs/static/typedoc/types/FilterFactory.html +1 -1
- package/docs/static/typedoc/types/FilterFn.html +1 -1
- package/docs/static/typedoc/types/HttpPromise.html +1 -0
- package/docs/static/typedoc/types/Injectable.html +1 -1
- package/docs/static/typedoc/types/InjectableFactory.html +1 -1
- package/docs/static/typedoc/types/LogCall.html +2 -0
- package/docs/static/typedoc/types/LogServiceFactory.html +2 -0
- package/docs/static/typedoc/types/OnChangesObject.html +1 -1
- package/docs/static/typedoc/types/SwapInsertPosition.html +1 -1
- package/docs/static/typedoc/types/TController.html +1 -1
- package/docs/static/typedoc/types/TemplateCache.html +2 -0
- package/docs/static/typedoc/variables/EventBus.html +1 -0
- package/index.html +4 -2
- package/package.json +3 -3
- package/src/animations/animate-css.js +5 -1
- package/src/binding.spec.js +3 -1
- package/src/core/compile/compile.spec.js +12 -5
- package/src/core/core.html +0 -1
- package/src/core/exception-handler.js +1 -1
- package/src/core/prop.spec.js +1 -0
- package/src/core/task-tracker-factory.js +2 -2
- package/src/directive/bind/bind.spec.js +1 -4
- package/src/directive/channel/channel.js +8 -24
- package/src/directive/channel/channel.spec.js +4 -2
- package/src/directive/class/class.js +16 -0
- package/src/directive/class/class.spec.js +2 -0
- package/src/directive/events/event.spec.js +1 -0
- package/src/directive/events/events.js +21 -24
- package/src/directive/form/form.spec.js +2 -0
- package/src/directive/http/http.js +4 -4
- package/src/directive/if/if.spec.js +2 -0
- package/src/directive/include/include.spec.js +1 -0
- package/src/directive/input/input.spec.js +1 -0
- package/src/directive/model/model.spec.js +3 -0
- package/src/directive/model-options/model-options.spec.js +2 -0
- package/src/directive/observe/{test.html → observe-demo.html} +0 -1
- package/src/directive/observe/observe.spec.js +2 -1
- package/src/{core/pubsub/pubsub.html → directive/on/on.html} +1 -1
- package/src/{core → directive/on}/on.spec.js +5 -3
- package/src/directive/on/on.test.js +11 -0
- package/src/directive/options/options.spec.js +1 -0
- package/src/directive/script/script.js +1 -1
- package/src/directive/select/select.spec.js +1 -0
- package/src/directive/setter/setter.js +1 -1
- package/src/directive/setter/setter.spec.js +2 -0
- package/src/directive/switch/switch.spec.js +1 -0
- package/src/injection-tokens.js +3 -0
- package/src/interface.ts +10 -0
- package/src/loader.js +3 -6
- package/src/public.js +3 -3
- package/src/router/directives/state-directives.spec.js +3 -1
- package/src/router/params/param-factory.js +6 -0
- package/src/router/params/param.js +22 -7
- package/src/router/router.html +0 -1
- package/src/router/router.test.js +2 -1
- package/src/router/services.spec.js +2 -0
- package/src/router/state/state-builder.js +3 -0
- package/src/router/state/state-builder.spec.js +2 -0
- package/src/router/state/state-service.js +1 -1
- package/src/router/state-filter.spec.js +2 -0
- package/src/router/template-factory.html +19 -0
- package/src/router/template-factory.js +3 -3
- package/src/router/template-factory.spec.js +1 -0
- package/src/router/template-factory.test.js +12 -0
- package/src/router/transition/transition-hook.js +1 -1
- package/src/router/url/url-service.js +1 -1
- package/src/router/view-scroll.spec.js +3 -1
- package/src/services/http/http.js +4 -4
- package/src/services/http/http.test.js +1 -1
- package/src/services/http/interface.ts +243 -0
- package/src/services/http-backend/http-backend.js +21 -11
- package/src/services/log/interface.ts +39 -0
- package/src/services/log/log.html +19 -0
- package/src/services/log/log.js +74 -0
- package/src/services/log/log.spec.js +64 -0
- package/src/services/log/log.test.js +11 -0
- package/src/services/pubsub/pubsub.html +19 -0
- package/src/{core → services}/pubsub/pubsub.js +6 -5
- package/src/{core → services}/pubsub/pubsub.spec.js +3 -3
- package/src/{core → services}/pubsub/pubsub.test.js +1 -1
- package/src/services/template-cache/interface.ts +4 -0
- package/src/services/template-cache/template-cache.html +22 -0
- package/src/services/template-cache/template-cache.js +13 -0
- package/src/services/template-cache/template-cache.spec.js +62 -0
- package/src/services/template-cache/template-cache.test.js +11 -0
- package/src/services/template-request.js +2 -2
- package/src/shared/cache.js +9 -0
- package/src/shared/dom.js +13 -7
- package/utils/express.js +7 -9
- package/@types/core/cache/cache-factory.d.ts +0 -22
- package/@types/core/cache/cache.d.ts +0 -28
- package/@types/services/log.d.ts +0 -53
- package/src/core/cache/cache-factory.js +0 -19
- package/src/core/cache/cache.js +0 -27
- package/src/directive/class/class.md +0 -90
- package/src/directive/cloak/cloak.md +0 -24
- package/src/examples/counter.html +0 -20
- package/src/services/log.js +0 -95
- package/src/services/log.md +0 -39
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<title>AngularTS</title>
|
|
6
|
-
<link rel="shortcut icon" type="image/png" href="/images/favicon.ico" />
|
|
7
|
-
<script type="module" src="/src/index.js"></script>
|
|
8
|
-
<link rel="stylesheet" href="/css/angular.css" />
|
|
9
|
-
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
|
10
|
-
</head>
|
|
11
|
-
<body ng-app ng-cloak>
|
|
12
|
-
<button
|
|
13
|
-
class="bg-gray-100 p-2 rounded-md outline outline-gray-950/10 m-6"
|
|
14
|
-
ng-init="count = 0"
|
|
15
|
-
ng-click="count = count + 1"
|
|
16
|
-
>
|
|
17
|
-
Count is: {{ count }}
|
|
18
|
-
</button>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|
package/src/services/log.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { isError } from "../shared/utils.js";
|
|
2
|
-
|
|
3
|
-
///////////////////////////////////////////////////////////////////////////
|
|
4
|
-
// LogService
|
|
5
|
-
// see http://docs.angularjs.org/api/ng/service/$log
|
|
6
|
-
// see http://docs.angularjs.org/api/ng/provider/$logProvider
|
|
7
|
-
///////////////////////////////////////////////////////////////////////////
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {(...args: any[]) => void} LogCall
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @typedef {Object} LogService
|
|
15
|
-
* @property {LogCall} debug - Log a debug messages
|
|
16
|
-
* @property {LogCall} error - Log a error message
|
|
17
|
-
* @property {LogCall} info - Log a info message
|
|
18
|
-
* @property {LogCall} log - Log a general message
|
|
19
|
-
* @property {LogCall} warn - Log a warning message
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @type {LogService}
|
|
24
|
-
*/
|
|
25
|
-
export let LogService = {
|
|
26
|
-
debug: undefined,
|
|
27
|
-
error: undefined,
|
|
28
|
-
info: undefined,
|
|
29
|
-
log: undefined,
|
|
30
|
-
warn: undefined,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @type {LogProvider}
|
|
35
|
-
* Use the `$logProvider` to configure how the application logs messages
|
|
36
|
-
*/
|
|
37
|
-
export class LogProvider {
|
|
38
|
-
constructor() {
|
|
39
|
-
this.debug = true;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @param {boolean=} flag enable or disable debug level messages
|
|
44
|
-
* @returns {*} current value if used as getter or itself (chaining) if used as setter
|
|
45
|
-
*/
|
|
46
|
-
debugEnabled(flag) {
|
|
47
|
-
if (typeof flag !== "undefined") {
|
|
48
|
-
this.debug = flag;
|
|
49
|
-
return this;
|
|
50
|
-
}
|
|
51
|
-
return this.debug;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
formatError(arg) {
|
|
55
|
-
if (isError(arg)) {
|
|
56
|
-
if (arg.stack) {
|
|
57
|
-
arg =
|
|
58
|
-
arg.message && arg.stack.indexOf(arg.message) === -1
|
|
59
|
-
? `Error: ${arg.message}\n${arg.stack}`
|
|
60
|
-
: arg.stack;
|
|
61
|
-
} else if (arg.sourceURL) {
|
|
62
|
-
arg = `${arg.message}\n${arg.sourceURL}:${arg.line}`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return arg;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
consoleLog(type) {
|
|
69
|
-
const console = window.console || {};
|
|
70
|
-
const logFn = console[type] || console.log || (() => {});
|
|
71
|
-
|
|
72
|
-
return (...args) => {
|
|
73
|
-
const formattedArgs = args.map((arg) => this.formatError(arg));
|
|
74
|
-
return logFn.apply(console, formattedArgs);
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
$get() {
|
|
79
|
-
LogService = {
|
|
80
|
-
log: this.consoleLog("log"),
|
|
81
|
-
info: this.consoleLog("info"),
|
|
82
|
-
warn: this.consoleLog("warn"),
|
|
83
|
-
error: this.consoleLog("error"),
|
|
84
|
-
debug: (() => {
|
|
85
|
-
const fn = this.consoleLog("debug");
|
|
86
|
-
return (...args) => {
|
|
87
|
-
if (this.debug) {
|
|
88
|
-
fn.apply(this, args);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
})(),
|
|
92
|
-
};
|
|
93
|
-
return LogService;
|
|
94
|
-
}
|
|
95
|
-
}
|
package/src/services/log.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# $log
|
|
2
|
-
|
|
3
|
-
Simple service for logging. Default implementation safely writes the message into the browser's console (if present).
|
|
4
|
-
|
|
5
|
-
The main purpose of this service is to simplify debugging and troubleshooting.
|
|
6
|
-
|
|
7
|
-
To reveal the location of the calls to `$log` in the JavaScript console, you can "blackbox" the AngularTS source in your browser:
|
|
8
|
-
|
|
9
|
-
- [Mozilla description of blackboxing](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Black_box_a_source).
|
|
10
|
-
- [Chrome description of blackboxing](https://developer.chrome.com/devtools/docs/blackboxing).
|
|
11
|
-
|
|
12
|
-
Note: Not all browsers support blackboxing.
|
|
13
|
-
|
|
14
|
-
The default is to log `debug` messages. You can use [`ng.$logProvider.debugEnabled`](https://docs.angularjs.org/api/ng/provider/$logProvider#debugEnabled) to change this.
|
|
15
|
-
|
|
16
|
-
## Example
|
|
17
|
-
|
|
18
|
-
```html
|
|
19
|
-
<example module="logExample" name="log-service">
|
|
20
|
-
<file name="script.js">
|
|
21
|
-
angular.module('logExample', []) .controller('LogController', ['$scope',
|
|
22
|
-
'$log', function($scope, $log) { $scope.$log = $log; $scope.message = 'Hello
|
|
23
|
-
World!'; }]);
|
|
24
|
-
</file>
|
|
25
|
-
<file name="index.html">
|
|
26
|
-
<div ng-controller="LogController">
|
|
27
|
-
<p>
|
|
28
|
-
Reload this page with open console, enter text and hit the log button...
|
|
29
|
-
</p>
|
|
30
|
-
<label>Message: <input type="text" ng-model="message" /></label>
|
|
31
|
-
<button ng-click="$log.log(message)">log</button>
|
|
32
|
-
<button ng-click="$log.warn(message)">warn</button>
|
|
33
|
-
<button ng-click="$log.info(message)">info</button>
|
|
34
|
-
<button ng-click="$log.error(message)">error</button>
|
|
35
|
-
<button ng-click="$log.debug(message)">debug</button>
|
|
36
|
-
</div>
|
|
37
|
-
</file>
|
|
38
|
-
</example>
|
|
39
|
-
```
|