FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nativescript-angular/nativescript-angular/dom-adapter.ts at master · bradfrost1/nativescript-angular · GitHub
bradfrost1
/
nativescript-angular
Public
forked from
NativeScript/nativescript-angular
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
nativescript-angular
/
nativescript-angular
/
dom-adapter.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
79 lines (63 loc) · 1.73 KB
Breadcrumbs
nativescript-angular
/
nativescript-angular
/
dom-adapter.ts
Copy path
File metadata and controls
79 lines (63 loc) · 1.73 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import
{
ElementSchemaRegistry
}
from
'@angular/compiler'
;
import
{
Sanitizer
,
SchemaMetadata
}
from
'@angular/core'
;
import
{
Parse5DomAdapter
}
from
"./parse5_adapter"
;
import
{
setRootDomAdapter
}
from
'./private_import_platform-browser'
;
import
{
rendererLog
,
rendererError
}
from
"./trace"
;
import
{
print
}
from
"./lang-facade"
;
export
enum
SecurityContext
{
NONE
,
HTML
,
STYLE
,
SCRIPT
,
URL
,
RESOURCE_URL
,
}
export
class
NativeScriptElementSchemaRegistry
extends
ElementSchemaRegistry
{
hasProperty
(
tagName
:
string
,
propName
:
string
)
:
boolean
{
return
true
;
}
hasElement
(
tagName
:
string
,
schemaMetas
:
SchemaMetadata
[
]
)
:
boolean
{
return
true
;
}
getMappedPropName
(
propName
:
string
)
:
string
{
return
propName
;
}
getDefaultComponentElementName
(
)
:
string
{
return
'ng-component'
;
}
securityContext
(
tagName
:
string
,
propName
:
string
)
:
any
{
return
SecurityContext
.
NONE
;
}
validateProperty
(
name
:
string
)
:
{
error
:
boolean
,
msg
?:
string
}
{
return
{
error
:
false
}
;
}
validateAttribute
(
name
:
string
)
:
{
error
:
boolean
,
msg
?:
string
}
{
return
{
error
:
false
}
;
}
}
export
class
NativeScriptSanitizer
extends
Sanitizer
{
sanitize
(
context
:
SecurityContext
,
value
:
string
)
:
string
{
return
value
;
}
}
export
class
NativeScriptDomAdapter
extends
Parse5DomAdapter
{
static
makeCurrent
(
)
{
rendererLog
(
"Setting DOM"
)
;
setRootDomAdapter
(
new
NativeScriptDomAdapter
(
)
)
;
}
hasProperty
(
element
,
name
:
string
)
{
//TODO: actually check if the property exists.
return
true
;
}
log
(
arg
:
any
)
:
void
{
print
(
arg
)
;
}
logError
(
arg
:
any
)
:
void
{
print
(
arg
)
;
}
logGroup
(
arg
:
any
)
:
void
{
print
(
arg
)
;
}
logGroupEnd
(
)
:
void
{
}
}
Back
|
FazBrowse Home
|
New Git URL