@angular-wave/angular.ts 0.0.7 → 0.0.8
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/dist/angular-ts.cjs.js +1 -1
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/docs/.cspell.yml +8 -0
- package/docs/.github/dependabot.yml +14 -0
- package/docs/.nvmrc +1 -0
- package/docs/CONTRIBUTING.md +28 -0
- package/docs/Dockerfile +4 -0
- package/docs/LICENSE +201 -0
- package/docs/README.md +184 -0
- package/docs/assets/scss/_variables_project.scss +6 -0
- package/docs/config.yaml +15 -0
- package/docs/content/en/_index.md +77 -0
- package/docs/content/en/about/featured-background.jpg +0 -0
- package/docs/content/en/about/index.md +35 -0
- package/docs/content/en/blog/_index.md +8 -0
- package/docs/content/en/blog/news/_index.md +4 -0
- package/docs/content/en/blog/news/first-post/featured-sunset-get.png +0 -0
- package/docs/content/en/blog/news/first-post/index.md +48 -0
- package/docs/content/en/blog/news/second-post.md +244 -0
- package/docs/content/en/blog/releases/_index.md +4 -0
- package/docs/content/en/blog/releases/in-depth-monoliths-detailed-spec.md +244 -0
- package/docs/content/en/community/_index.md +6 -0
- package/docs/content/en/docs/_index.md +29 -0
- package/docs/content/en/docs/concepts/_index.md +14 -0
- package/docs/content/en/docs/contribution-guidelines/_index.md +79 -0
- package/docs/content/en/docs/examples/_index.md +13 -0
- package/docs/content/en/docs/getting-started/_index.md +35 -0
- package/docs/content/en/docs/getting-started/example-page.md +240 -0
- package/docs/content/en/docs/overview/_index.md +36 -0
- package/docs/content/en/docs/reference/_index.md +12 -0
- package/docs/content/en/docs/reference/parameter-reference.md +211 -0
- package/docs/content/en/docs/tasks/Ponycopters/_index.md +12 -0
- package/docs/content/en/docs/tasks/Ponycopters/configuring-ponycopters.md +238 -0
- package/docs/content/en/docs/tasks/Ponycopters/launching-ponycopters.md +236 -0
- package/docs/content/en/docs/tasks/_index.md +21 -0
- package/docs/content/en/docs/tasks/beds.md +237 -0
- package/docs/content/en/docs/tasks/porridge.md +237 -0
- package/docs/content/en/docs/tasks/task.md +237 -0
- package/docs/content/en/docs/tutorials/_index.md +13 -0
- package/docs/content/en/docs/tutorials/multi-bear.md +236 -0
- package/docs/content/en/docs/tutorials/tutorial2.md +236 -0
- package/docs/content/en/featured-background.jpg +0 -0
- package/docs/content/en/search.md +4 -0
- package/docs/docker-compose.yaml +13 -0
- package/docs/docsy.work +5 -0
- package/docs/docsy.work.sum +0 -0
- package/docs/go.mod +5 -0
- package/docs/go.sum +6 -0
- package/docs/hugo-disabled.toml +221 -0
- package/docs/hugo.yaml +220 -0
- package/docs/layouts/404.html +7 -0
- package/docs/layouts/_default/_markup/render-heading.html +1 -0
- package/docs/netlify.toml +12 -0
- package/docs/package.json +42 -0
- package/package.json +1 -1
- package/src/core/compile.js +13 -165
- package/src/core/compile.md +51 -16
- package/src/core/filter.md +23 -17
- package/src/core/interval.md +73 -72
- package/src/core/sce.js +2 -13
- package/src/injector.md +30 -1
- package/test/messages/messages.spec.js +1 -1
- package/test/ng/compile.spec.js +91 -289
- package/test/ng/directive/form.spec.js +8 -8
package/docs/hugo.yaml
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
baseURL: https://example.docsy.dev
|
|
2
|
+
title: Goldydocs
|
|
3
|
+
|
|
4
|
+
# cSpell:ignore goldmark github hugo readingtime docsy subdir lastmod pygments linenos catmullrom norsk gu
|
|
5
|
+
|
|
6
|
+
# Language settings
|
|
7
|
+
contentDir: content/en
|
|
8
|
+
defaultContentLanguage: en
|
|
9
|
+
defaultContentLanguageInSubdir: false
|
|
10
|
+
# Useful when translating.
|
|
11
|
+
enableMissingTranslationPlaceholders: true
|
|
12
|
+
|
|
13
|
+
enableRobotsTXT: true
|
|
14
|
+
|
|
15
|
+
# Will give values to .Lastmod etc.
|
|
16
|
+
enableGitInfo: true
|
|
17
|
+
|
|
18
|
+
# Comment out to enable taxonomies in Docsy
|
|
19
|
+
# disableKinds: [taxonomy, taxonomyTerm]
|
|
20
|
+
|
|
21
|
+
# You can add your own taxonomies
|
|
22
|
+
taxonomies:
|
|
23
|
+
tag: tags
|
|
24
|
+
category: categories
|
|
25
|
+
|
|
26
|
+
# Highlighting config
|
|
27
|
+
pygmentsCodeFences: true
|
|
28
|
+
pygmentsUseClasses: false
|
|
29
|
+
# Use the new Chroma Go highlighter in Hugo.
|
|
30
|
+
pygmentsUseClassic: false
|
|
31
|
+
# pygmentsOptions: "linenos=table"
|
|
32
|
+
# See https://help.farbox.com/pygments.html
|
|
33
|
+
pygmentsStyle: tango
|
|
34
|
+
|
|
35
|
+
# Configure how URLs look like per section.
|
|
36
|
+
permalinks:
|
|
37
|
+
blog: /:section/:year/:month/:day/:slug/
|
|
38
|
+
|
|
39
|
+
# Image processing configuration.
|
|
40
|
+
imaging:
|
|
41
|
+
resampleFilter: CatmullRom
|
|
42
|
+
quality: 75
|
|
43
|
+
anchor: smart
|
|
44
|
+
|
|
45
|
+
# Language configuration
|
|
46
|
+
languages:
|
|
47
|
+
en:
|
|
48
|
+
languageName: English
|
|
49
|
+
title: Goldydocs
|
|
50
|
+
params:
|
|
51
|
+
description: A Docsy example site
|
|
52
|
+
# cSpell:disable
|
|
53
|
+
'no':
|
|
54
|
+
languageName: Norsk
|
|
55
|
+
contentDir: content/no
|
|
56
|
+
title: Gulldoks
|
|
57
|
+
params:
|
|
58
|
+
description: Docsy er operativsystem for skyen
|
|
59
|
+
time_format_default: 02.01.2006
|
|
60
|
+
time_format_blog: 02.01.2006
|
|
61
|
+
fa:
|
|
62
|
+
languageDirection: rtl
|
|
63
|
+
languageName: "فارسی (Persian)"
|
|
64
|
+
contentDir: content/fa
|
|
65
|
+
title: "اسناد گلدی"
|
|
66
|
+
params:
|
|
67
|
+
description: "یک نمونه برای پوسته داکسی"
|
|
68
|
+
time_format_default: 2006.01.02
|
|
69
|
+
time_format_blog: 2006.01.02
|
|
70
|
+
# cSpell:enable
|
|
71
|
+
|
|
72
|
+
markup:
|
|
73
|
+
goldmark:
|
|
74
|
+
parser:
|
|
75
|
+
attribute:
|
|
76
|
+
block: true
|
|
77
|
+
renderer:
|
|
78
|
+
unsafe: true
|
|
79
|
+
highlight:
|
|
80
|
+
# See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html
|
|
81
|
+
style: tango
|
|
82
|
+
# Uncomment if you want your chosen highlight style used for code blocks without a specified language
|
|
83
|
+
# guessSyntax: true
|
|
84
|
+
|
|
85
|
+
# Everything below this are Site Params
|
|
86
|
+
|
|
87
|
+
# Comment out if you don't want the "print entire section" link enabled.
|
|
88
|
+
outputs:
|
|
89
|
+
section: [HTML, print, RSS]
|
|
90
|
+
|
|
91
|
+
params:
|
|
92
|
+
taxonomy:
|
|
93
|
+
# set taxonomyCloud = [] to hide taxonomy clouds
|
|
94
|
+
taxonomyCloud: [tags, categories]
|
|
95
|
+
|
|
96
|
+
# If used, must have same length as taxonomyCloud
|
|
97
|
+
taxonomyCloudTitle: [Tag Cloud, Categories]
|
|
98
|
+
|
|
99
|
+
# set taxonomyPageHeader = [] to hide taxonomies on the page headers
|
|
100
|
+
taxonomyPageHeader: [tags, categories]
|
|
101
|
+
|
|
102
|
+
privacy_policy: https://policies.google.com/privacy
|
|
103
|
+
|
|
104
|
+
# First one is picked as the Twitter card image if not set on page.
|
|
105
|
+
# images: [images/project-illustration.png]
|
|
106
|
+
|
|
107
|
+
# Menu title if your navbar has a versions selector to access old versions of your site.
|
|
108
|
+
# This menu appears only if you have at least one [params.versions] set.
|
|
109
|
+
version_menu: Releases
|
|
110
|
+
|
|
111
|
+
# Flag used in the "version-banner" partial to decide whether to display a
|
|
112
|
+
# banner on every page indicating that this is an archived version of the docs.
|
|
113
|
+
# Set this flag to "true" if you want to display the banner.
|
|
114
|
+
archived_version: false
|
|
115
|
+
|
|
116
|
+
# The version number for the version of the docs represented in this doc set.
|
|
117
|
+
# Used in the "version-banner" partial to display a version number for the
|
|
118
|
+
# current doc set.
|
|
119
|
+
version: 0.0
|
|
120
|
+
|
|
121
|
+
# A link to latest version of the docs. Used in the "version-banner" partial to
|
|
122
|
+
# point people to the main doc site.
|
|
123
|
+
url_latest_version: https://example.com
|
|
124
|
+
|
|
125
|
+
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
|
|
126
|
+
github_repo: https://github.com/google/docsy-example
|
|
127
|
+
|
|
128
|
+
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
|
|
129
|
+
github_project_repo: https://github.com/google/docsy
|
|
130
|
+
|
|
131
|
+
# Specify a value here if your content directory is not in your repo's root directory
|
|
132
|
+
# github_subdir: ""
|
|
133
|
+
|
|
134
|
+
# Uncomment this if your GitHub repo does not have "main" as the default branch,
|
|
135
|
+
# or specify a new value if you want to reference another branch in your GitHub links
|
|
136
|
+
github_branch: main
|
|
137
|
+
|
|
138
|
+
# Google Custom Search Engine ID. Remove or comment out to disable search.
|
|
139
|
+
gcs_engine_id: d72aa9b2712488cc3
|
|
140
|
+
|
|
141
|
+
# Enable Lunr.js offline search
|
|
142
|
+
offlineSearch: false
|
|
143
|
+
|
|
144
|
+
# Enable syntax highlighting and copy buttons on code blocks with Prism
|
|
145
|
+
prism_syntax_highlighting: false
|
|
146
|
+
|
|
147
|
+
copyright:
|
|
148
|
+
authors: Docsy Authors | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0) |
|
|
149
|
+
from_year: 2018
|
|
150
|
+
|
|
151
|
+
# User interface configuration
|
|
152
|
+
ui:
|
|
153
|
+
# Set to true to disable breadcrumb navigation.
|
|
154
|
+
breadcrumb_disable: false
|
|
155
|
+
# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top navbar
|
|
156
|
+
navbar_logo: true
|
|
157
|
+
# Set to true if you don't want the top navbar to be translucent when over a `block/cover`, like on the homepage.
|
|
158
|
+
navbar_translucent_over_cover_disable: false
|
|
159
|
+
# Enable to show the side bar menu in its compact state.
|
|
160
|
+
sidebar_menu_compact: false
|
|
161
|
+
# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled)
|
|
162
|
+
sidebar_search_disable: false
|
|
163
|
+
|
|
164
|
+
# Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events.
|
|
165
|
+
# This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set.
|
|
166
|
+
# If you want this feature, but occasionally need to remove the "Feedback" section from a single page,
|
|
167
|
+
# add "hide_feedback: true" to the page's front matter.
|
|
168
|
+
feedback:
|
|
169
|
+
enable: true
|
|
170
|
+
# The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful).
|
|
171
|
+
'yes': >-
|
|
172
|
+
Glad to hear it! Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.
|
|
173
|
+
'no': >-
|
|
174
|
+
Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.
|
|
175
|
+
|
|
176
|
+
# Adds a reading time to the top of each doc.
|
|
177
|
+
# If you want this feature, but occasionally need to remove the Reading time from a single page,
|
|
178
|
+
# add "hide_readingtime: true" to the page's front matter
|
|
179
|
+
readingtime:
|
|
180
|
+
enable: false
|
|
181
|
+
|
|
182
|
+
links:
|
|
183
|
+
# End user relevant links. These will show up on left side of footer and in the community page if you have one.
|
|
184
|
+
user:
|
|
185
|
+
- name: User mailing list
|
|
186
|
+
url: https://example.org/mail
|
|
187
|
+
icon: fa fa-envelope
|
|
188
|
+
desc: Discussion and help from your fellow users
|
|
189
|
+
- name: Twitter
|
|
190
|
+
url: https://example.org/twitter
|
|
191
|
+
icon: fab fa-twitter
|
|
192
|
+
desc: Follow us on Twitter to get the latest news!
|
|
193
|
+
- name: Stack Overflow
|
|
194
|
+
url: https://example.org/stack
|
|
195
|
+
icon: fab fa-stack-overflow
|
|
196
|
+
desc: Practical questions and curated answers
|
|
197
|
+
# Developer relevant links. These will show up on right side of footer and in the community page if you have one.
|
|
198
|
+
developer:
|
|
199
|
+
- name: GitHub
|
|
200
|
+
url: https://github.com/google/docsy
|
|
201
|
+
icon: fab fa-github
|
|
202
|
+
desc: Development takes place here!
|
|
203
|
+
- name: Slack
|
|
204
|
+
url: https://example.org/slack
|
|
205
|
+
icon: fab fa-slack
|
|
206
|
+
desc: Chat with other project developers
|
|
207
|
+
- name: Developer mailing list
|
|
208
|
+
url: https://example.org/mail
|
|
209
|
+
icon: fa fa-envelope
|
|
210
|
+
desc: Discuss development issues around the project
|
|
211
|
+
|
|
212
|
+
module:
|
|
213
|
+
# Uncomment the next line to build and serve using local docsy clone declared in the named Hugo workspace:
|
|
214
|
+
# workspace: docsy.work
|
|
215
|
+
hugoVersion:
|
|
216
|
+
extended: true
|
|
217
|
+
min: 0.110.0
|
|
218
|
+
imports:
|
|
219
|
+
- path: github.com/google/docsy
|
|
220
|
+
disable: false
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{{ define "main" -}}
|
|
2
|
+
<div class="td-content">
|
|
3
|
+
<h1>Not found</h1>
|
|
4
|
+
<p>Oops! This page doesn't exist. Try going back to the <a href="{{ "" | relURL }}">home page</a>.</p>
|
|
5
|
+
<p>You can learn how to make a 404 page like this in <a href="https://gohugo.io/templates/404/">Custom 404 Pages</a>.</p>
|
|
6
|
+
</div>
|
|
7
|
+
{{- end }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ template "_default/_markup/td-render-heading.html" . }}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Hugo build configuration for Netlify
|
|
2
|
+
# (https://gohugo.io/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify)
|
|
3
|
+
|
|
4
|
+
[build]
|
|
5
|
+
command = "npm run build:preview"
|
|
6
|
+
publish = "public"
|
|
7
|
+
|
|
8
|
+
[build.environment]
|
|
9
|
+
GO_VERSION = "1.22.2"
|
|
10
|
+
|
|
11
|
+
[context.production]
|
|
12
|
+
command = "npm run build:production"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docsy-example-site",
|
|
3
|
+
"version": "0.10.0",
|
|
4
|
+
"version.next": "0.10.1-dev.0-unreleased",
|
|
5
|
+
"description": "Example site that uses Docsy theme for technical documentation.",
|
|
6
|
+
"repository": "github:google/docsy-example",
|
|
7
|
+
"homepage": "https://example.docsy.dev",
|
|
8
|
+
"author": "Docsy Authors",
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"bugs": "https://github.com/google/docsy-example/issues",
|
|
11
|
+
"spelling": "cSpell:ignore HTMLTEST precheck postbuild -",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"_build": "npm run _hugo-dev --",
|
|
14
|
+
"_check:links": "echo IMPLEMENTATION PENDING for check-links; echo",
|
|
15
|
+
"_hugo": "hugo --cleanDestinationDir",
|
|
16
|
+
"_hugo-dev": "npm run _hugo -- -e dev -DFE",
|
|
17
|
+
"_local": "npx cross-env HUGO_MODULE_WORKSPACE=docsy.work",
|
|
18
|
+
"_serve": "npm run _hugo-dev -- --minify serve --renderToMemory",
|
|
19
|
+
"build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"",
|
|
20
|
+
"build:production": "npm run _hugo -- --minify",
|
|
21
|
+
"build": "npm run _build -- ",
|
|
22
|
+
"check:links:all": "HTMLTEST_ARGS= npm run _check:links",
|
|
23
|
+
"check:links": "npm run _check:links",
|
|
24
|
+
"clean": "rm -Rf public/* resources",
|
|
25
|
+
"local": "npm run _local -- npm run",
|
|
26
|
+
"make:public": "git init -b main public",
|
|
27
|
+
"precheck:links:all": "npm run build",
|
|
28
|
+
"precheck:links": "npm run build",
|
|
29
|
+
"postbuild:preview": "npm run _check:links",
|
|
30
|
+
"postbuild:production": "npm run _check:links",
|
|
31
|
+
"serve": "npm run _serve",
|
|
32
|
+
"test": "npm run check:links",
|
|
33
|
+
"update:dep": "npm install --save-dev autoprefixer@latest postcss-cli@latest",
|
|
34
|
+
"update:hugo": "npm install --save-dev --save-exact hugo-extended@latest"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"autoprefixer": "^10.4.14",
|
|
38
|
+
"cross-env": "^7.0.3",
|
|
39
|
+
"hugo-extended": "0.126.1",
|
|
40
|
+
"postcss-cli": "^11.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/package.json
CHANGED
package/src/core/compile.js
CHANGED
|
@@ -49,13 +49,11 @@ let config = { TTL: 10 };
|
|
|
49
49
|
*
|
|
50
50
|
* @description
|
|
51
51
|
*/
|
|
52
|
-
// eslint-disable-next-line no-use-before-define
|
|
53
52
|
$CompileProvider.$inject = ["$provide", "$$sanitizeUriProvider"];
|
|
54
53
|
|
|
55
54
|
export function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
56
55
|
const hasDirectives = {};
|
|
57
56
|
const Suffix = "Directive";
|
|
58
|
-
const COMMENT_DIRECTIVE_REGEXP = /^\s*directive:\s*([\w-]+)\s+(.*)$/;
|
|
59
57
|
const CLASS_DIRECTIVE_REGEXP = /(([\w-]+)(?::([^;]+))?;?)/;
|
|
60
58
|
const ALL_OR_NOTHING_ATTRS = {
|
|
61
59
|
ngSrc: true,
|
|
@@ -558,62 +556,6 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
558
556
|
return config.TTL;
|
|
559
557
|
};
|
|
560
558
|
|
|
561
|
-
let commentDirectivesEnabledConfig = true;
|
|
562
|
-
/**
|
|
563
|
-
* @ngdoc method
|
|
564
|
-
* @name $compileProvider#commentDirectivesEnabled
|
|
565
|
-
* @description
|
|
566
|
-
*
|
|
567
|
-
* It indicates to the compiler
|
|
568
|
-
* whether or not directives on comments should be compiled.
|
|
569
|
-
* Defaults to `true`.
|
|
570
|
-
*
|
|
571
|
-
* Calling this function with false disables the compilation of directives
|
|
572
|
-
* on comments for the whole application.
|
|
573
|
-
* This results in a compilation performance gain,
|
|
574
|
-
* as the compiler doesn't have to check comments when looking for directives.
|
|
575
|
-
* This should however only be used if you are sure that no comment directives are used in
|
|
576
|
-
* the application (including any 3rd party directives).
|
|
577
|
-
*
|
|
578
|
-
* @param {boolean} enabled `false` if the compiler may ignore directives on comments
|
|
579
|
-
* @returns {boolean|object} the current value (or `this` if called as a setter for chaining)
|
|
580
|
-
*/
|
|
581
|
-
this.commentDirectivesEnabled = function (value) {
|
|
582
|
-
if (arguments.length) {
|
|
583
|
-
commentDirectivesEnabledConfig = value;
|
|
584
|
-
return this;
|
|
585
|
-
}
|
|
586
|
-
return commentDirectivesEnabledConfig;
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
let cssClassDirectivesEnabledConfig = true;
|
|
590
|
-
/**
|
|
591
|
-
* @ngdoc method
|
|
592
|
-
* @name $compileProvider#cssClassDirectivesEnabled
|
|
593
|
-
* @description
|
|
594
|
-
*
|
|
595
|
-
* It indicates to the compiler
|
|
596
|
-
* whether or not directives on element classes should be compiled.
|
|
597
|
-
* Defaults to `true`.
|
|
598
|
-
*
|
|
599
|
-
* Calling this function with false disables the compilation of directives
|
|
600
|
-
* on element classes for the whole application.
|
|
601
|
-
* This results in a compilation performance gain,
|
|
602
|
-
* as the compiler doesn't have to check element classes when looking for directives.
|
|
603
|
-
* This should however only be used if you are sure that no class directives are used in
|
|
604
|
-
* the application (including any 3rd party directives).
|
|
605
|
-
*
|
|
606
|
-
* @param {boolean} enabled `false` if the compiler may ignore directives on element classes
|
|
607
|
-
* @returns {boolean|object} the current value (or `this` if called as a setter for chaining)
|
|
608
|
-
*/
|
|
609
|
-
this.cssClassDirectivesEnabled = function (value) {
|
|
610
|
-
if (arguments.length) {
|
|
611
|
-
cssClassDirectivesEnabledConfig = value;
|
|
612
|
-
return this;
|
|
613
|
-
}
|
|
614
|
-
return cssClassDirectivesEnabledConfig;
|
|
615
|
-
};
|
|
616
|
-
|
|
617
559
|
/**
|
|
618
560
|
* The security context of DOM Properties.
|
|
619
561
|
* @private
|
|
@@ -737,9 +679,6 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
737
679
|
const SIMPLE_ATTR_NAME = /^\w/;
|
|
738
680
|
const specialAttrHolder = window.document.createElement("div");
|
|
739
681
|
|
|
740
|
-
const commentDirectivesEnabled = commentDirectivesEnabledConfig;
|
|
741
|
-
const cssClassDirectivesEnabled = cssClassDirectivesEnabledConfig;
|
|
742
|
-
|
|
743
682
|
// The onChanges hooks should all be run together in a single digest
|
|
744
683
|
// When changes occur, the call to trigger their hooks will be added to this queue
|
|
745
684
|
let onChangesQueue;
|
|
@@ -1574,44 +1513,11 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
1574
1513
|
node.setAttribute("autocomplete", "off");
|
|
1575
1514
|
}
|
|
1576
1515
|
|
|
1577
|
-
// use class as directive
|
|
1578
|
-
if (!cssClassDirectivesEnabled) break;
|
|
1579
|
-
// TODO: migrate to classList
|
|
1580
|
-
className = node.className;
|
|
1581
|
-
if (isObject(className)) {
|
|
1582
|
-
// Maybe SVGAnimatedString
|
|
1583
|
-
className = className.animVal;
|
|
1584
|
-
}
|
|
1585
|
-
if (isString(className) && className !== "") {
|
|
1586
|
-
while ((match = CLASS_DIRECTIVE_REGEXP.exec(className))) {
|
|
1587
|
-
nName = directiveNormalize(match[2]);
|
|
1588
|
-
if (
|
|
1589
|
-
addDirective(
|
|
1590
|
-
directives,
|
|
1591
|
-
nName,
|
|
1592
|
-
"C",
|
|
1593
|
-
maxPriority,
|
|
1594
|
-
ignoreDirective,
|
|
1595
|
-
)
|
|
1596
|
-
) {
|
|
1597
|
-
attrs[nName] = trim(match[3]);
|
|
1598
|
-
}
|
|
1599
|
-
className = className.substr(match.index + match[0].length);
|
|
1600
|
-
}
|
|
1601
|
-
}
|
|
1602
1516
|
break;
|
|
1603
1517
|
case Node.TEXT_NODE:
|
|
1604
1518
|
addTextInterpolateDirective(directives, node.nodeValue);
|
|
1605
1519
|
break;
|
|
1606
|
-
|
|
1607
|
-
if (!commentDirectivesEnabled) break;
|
|
1608
|
-
collectCommentDirectives(
|
|
1609
|
-
node,
|
|
1610
|
-
directives,
|
|
1611
|
-
attrs,
|
|
1612
|
-
maxPriority,
|
|
1613
|
-
ignoreDirective,
|
|
1614
|
-
);
|
|
1520
|
+
default:
|
|
1615
1521
|
break;
|
|
1616
1522
|
}
|
|
1617
1523
|
|
|
@@ -1619,32 +1525,6 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
1619
1525
|
return directives;
|
|
1620
1526
|
}
|
|
1621
1527
|
|
|
1622
|
-
function collectCommentDirectives(
|
|
1623
|
-
node,
|
|
1624
|
-
directives,
|
|
1625
|
-
attrs,
|
|
1626
|
-
maxPriority,
|
|
1627
|
-
ignoreDirective,
|
|
1628
|
-
) {
|
|
1629
|
-
// function created because of performance, try/catch disables
|
|
1630
|
-
// the optimization of the whole function #14848
|
|
1631
|
-
try {
|
|
1632
|
-
const match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
|
|
1633
|
-
if (match) {
|
|
1634
|
-
const nName = directiveNormalize(match[1]);
|
|
1635
|
-
if (
|
|
1636
|
-
addDirective(directives, nName, "M", maxPriority, ignoreDirective)
|
|
1637
|
-
) {
|
|
1638
|
-
attrs[nName] = trim(match[2]);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
} catch (e) {
|
|
1642
|
-
// turns out that under some circumstances IE9 throws errors when one attempts to read
|
|
1643
|
-
// comment's node value.
|
|
1644
|
-
// Just ignore it and continue. (Can't seem to reproduce in test case.)
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
1528
|
/**
|
|
1649
1529
|
* Given a node with a directive-start it collects all of the siblings until it finds
|
|
1650
1530
|
* directive-end.
|
|
@@ -3548,51 +3428,19 @@ export function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
3548
3428
|
];
|
|
3549
3429
|
}
|
|
3550
3430
|
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
return this.previousValue === _UNINITIALIZED_VALUE;
|
|
3557
|
-
};
|
|
3558
|
-
|
|
3559
|
-
/**
|
|
3560
|
-
* @ngdoc type
|
|
3561
|
-
* @name $compile.directive.Attributes
|
|
3562
|
-
*
|
|
3563
|
-
* @description
|
|
3564
|
-
* A shared object between directive compile / linking functions which contains normalized DOM
|
|
3565
|
-
* element attributes. The values reflect current binding state `{{ }}`. The normalization is
|
|
3566
|
-
* needed since all of these are treated as equivalent in AngularJS:
|
|
3567
|
-
*
|
|
3568
|
-
* ```
|
|
3569
|
-
* <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a">
|
|
3570
|
-
* ```
|
|
3571
|
-
*/
|
|
3572
|
-
|
|
3573
|
-
/**
|
|
3574
|
-
* @ngdoc property
|
|
3575
|
-
* @name $compile.directive.Attributes#$attr
|
|
3576
|
-
*
|
|
3577
|
-
* @description
|
|
3578
|
-
* A map of DOM element attribute names to the normalized name. This is
|
|
3579
|
-
* needed to do reverse lookup from normalized name back to actual name.
|
|
3580
|
-
*/
|
|
3431
|
+
class SimpleChange {
|
|
3432
|
+
constructor(previous, current) {
|
|
3433
|
+
this.previousValue = previous;
|
|
3434
|
+
this.currentValue = current;
|
|
3435
|
+
}
|
|
3581
3436
|
|
|
3582
|
-
/**
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
*
|
|
3590
|
-
*
|
|
3591
|
-
* @param {string} name Normalized element attribute name of the property to modify. The name is
|
|
3592
|
-
* reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
|
|
3593
|
-
* property to the original name.
|
|
3594
|
-
* @param {string} value Value to set the attribute to. The value can be an interpolated string.
|
|
3595
|
-
*/
|
|
3437
|
+
/**
|
|
3438
|
+
* @returns {boolean}
|
|
3439
|
+
*/
|
|
3440
|
+
isFirstChange() {
|
|
3441
|
+
return this.previousValue === _UNINITIALIZED_VALUE;
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3596
3444
|
|
|
3597
3445
|
function tokenDifference(str1, str2) {
|
|
3598
3446
|
let values = "";
|
package/src/core/compile.md
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
-
|
|
122
122
|
- ### Life-cycle hooks
|
|
123
123
|
- Directive controllers can provide the following methods that are called by AngularJS at points in the life-cycle of the
|
|
124
|
-
- directive:
|
|
124
|
+
- directive.The following hooks can be defined on the controller prototype or added to the controller inside its constructor:
|
|
125
125
|
- - `$onInit()` - Called on each controller after all the controllers on an element have been constructed and
|
|
126
126
|
- had their bindings initialized (and before the pre & post linking functions for the directives on
|
|
127
127
|
- this element). This is a good place to put initialization code for your controller.
|
|
@@ -136,6 +136,8 @@
|
|
|
136
136
|
- could be useful if you wish to perform a deep equality check, or to check a Date object, changes to which would not
|
|
137
137
|
- be detected by AngularJS's change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments;
|
|
138
138
|
- if detecting changes, you must store the previous value(s) for comparison to the current values.
|
|
139
|
+
- Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be
|
|
140
|
+
- propagated throughout the application.
|
|
139
141
|
- - `$onDestroy()` - Called on a controller when its containing scope is destroyed. Use this hook for releasing
|
|
140
142
|
- external resources, watches and event handlers. Note that components have their `$onDestroy()` hooks called in
|
|
141
143
|
- the same order as the `$scope.$broadcast` events are triggered, which is top down. This means that parent
|
|
@@ -145,21 +147,7 @@
|
|
|
145
147
|
- Note that child elements that contain `templateUrl` directives will not have been compiled and linked since
|
|
146
148
|
- they are waiting for their template to load asynchronously and their own compilation and linking has been
|
|
147
149
|
- suspended until that occurs.
|
|
148
|
-
|
|
149
|
-
- #### Comparison with life-cycle hooks in the new Angular
|
|
150
|
-
- The new Angular also uses life-cycle hooks for its components. While the AngularJS life-cycle hooks are similar there are
|
|
151
|
-
- some differences that you should be aware of, especially when it comes to moving your code from AngularJS to Angular:
|
|
152
|
-
-
|
|
153
|
-
- - AngularJS hooks are prefixed with `$`, such as `$onInit`. Angular hooks are prefixed with `ng`, such as `ngOnInit`.
|
|
154
|
-
- - AngularJS hooks can be defined on the controller prototype or added to the controller inside its constructor.
|
|
155
|
-
- In Angular you can only define hooks on the prototype of the Component class.
|
|
156
|
-
- - Due to the differences in change-detection, you may get many more calls to `$doCheck` in AngularJS than you would to
|
|
157
|
-
- `ngDoCheck` in Angular.
|
|
158
|
-
- - Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be
|
|
159
|
-
- propagated throughout the application.
|
|
160
|
-
- Angular does not allow the `ngDoCheck` hook to trigger a change outside of the component. It will either throw an
|
|
161
|
-
- error or do nothing depending upon the state of `enableProdMode()`.
|
|
162
|
-
-
|
|
150
|
+
|
|
163
151
|
- #### Life-cycle hook examples
|
|
164
152
|
-
|
|
165
153
|
- This example shows how you can check for mutations to a Date object even though the identity of the object
|
|
@@ -1016,6 +1004,7 @@
|
|
|
1016
1004
|
- Result: <span ng-class="{'something': something} {'else': else}" ng-show="!condition otherCondition"></span>
|
|
1017
1005
|
- ```
|
|
1018
1006
|
|
|
1007
|
+
``
|
|
1019
1008
|
```
|
|
1020
1009
|
|
|
1021
1010
|
-
|
|
@@ -1190,3 +1179,49 @@
|
|
|
1190
1179
|
- `myEvent` must be written as `ng-on-my_event="expression"`.
|
|
1191
1180
|
-
|
|
1192
1181
|
- \*/
|
|
1182
|
+
|
|
1183
|
+
/\*\*
|
|
1184
|
+
|
|
1185
|
+
- @ngdoc type
|
|
1186
|
+
- @name $compile.directive.Attributes
|
|
1187
|
+
-
|
|
1188
|
+
- @description
|
|
1189
|
+
- A shared object between directive compile / linking functions which contains normalized DOM
|
|
1190
|
+
- element attributes. The values reflect current binding state `{{ }}`. The normalization is
|
|
1191
|
+
- needed since all of these are treated as equivalent in AngularJS:
|
|
1192
|
+
-
|
|
1193
|
+
- ```
|
|
1194
|
+
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
- <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a">
|
|
1198
|
+
- ```
|
|
1199
|
+
*/
|
|
1200
|
+
```
|
|
1201
|
+
|
|
1202
|
+
/\*\*
|
|
1203
|
+
|
|
1204
|
+
- @ngdoc property
|
|
1205
|
+
- @name $compile.directive.Attributes#$attr
|
|
1206
|
+
-
|
|
1207
|
+
- @description
|
|
1208
|
+
- A map of DOM element attribute names to the normalized name. This is
|
|
1209
|
+
- needed to do reverse lookup from normalized name back to actual name.
|
|
1210
|
+
\*/
|
|
1211
|
+
|
|
1212
|
+
/\*\*
|
|
1213
|
+
|
|
1214
|
+
- @ngdoc method
|
|
1215
|
+
- @name $compile.directive.Attributes#$set
|
|
1216
|
+
- @kind function
|
|
1217
|
+
-
|
|
1218
|
+
- @description
|
|
1219
|
+
- Set DOM element attribute value.
|
|
1220
|
+
-
|
|
1221
|
+
-
|
|
1222
|
+
- @param {string} str1 Normalized element attribute name of the property to modify. The name is
|
|
1223
|
+
- reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
|
|
1224
|
+
- property to the original name.
|
|
1225
|
+
- @param {string} str2 Value to set the attribute to. The value can be an interpolated string.
|
|
1226
|
+
- @returns {string}
|
|
1227
|
+
\*/
|