Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
angular
web-table
Commits
5078bd2f
Commit
5078bd2f
authored
Apr 14, 2019
by
Zéfling
🎨
Browse files
Load files
parent
0971448d
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/app/app-nav.component.html
View file @
5078bd2f
<ul>
<li
*ngFor=
"let line of folders"
>
<li
class=
"folder"
*ngFor=
"let line of folders"
>
<div>
{{line.name}}
</div>
<app-nav
[path]=
"path + '/' + line.name"
[data]=
"line.data"
></app-nav>
</li>
<li
*ngFor=
"let line of files"
(click)=
"action(path + '/' + line.fileName, line.name)"
>
<li
class=
"file"
*ngFor=
"let line of files"
(click)=
"action(line.fileName)"
>
{{line.name}}
</li>
</ul>
\ No newline at end of file
src/app/app-nav.component.ts
View file @
5078bd2f
import
{
Component
,
Input
}
from
'
@angular/core
'
;
import
{
DataValue
}
from
'
./app.service
'
;
import
{
DataValue
,
AppService
}
from
'
./app.service
'
;
@
Component
({
selector
:
'
app-nav
'
,
...
...
@@ -39,5 +39,10 @@ export class AppNavComponent {
return
list
;
}
constructor
(
private
appService
:
AppService
)
{
}
action
(
path
:
string
)
{
this
.
appService
.
show
(
this
.
path
+
'
/
'
+
path
);
}
}
src/app/app.service.ts
View file @
5078bd2f
...
...
@@ -13,6 +13,7 @@ const pattern = /\.\/([^\/]+)\/(.*)/;
export
class
AppService
{
readonly
onData
=
new
Subject
<
void
>
();
readonly
changePage
=
new
Subject
<
void
>
();
isInit
=
false
;
...
...
@@ -28,7 +29,7 @@ export class AppService {
init
()
{
if
(
!
this
.
isInit
)
{
this
.
http
.
get
(
'
./assets/browser-co
n
pat-dat
e
.txt
'
,
{
responseType
:
'
text
'
})
.
get
(
'
./assets/browser-co
m
pat-dat
a
.txt
'
,
{
responseType
:
'
text
'
})
.
subscribe
(
(
data
:
string
)
=>
{
this
.
parselist
(
data
);
...
...
@@ -79,4 +80,20 @@ export class AppService {
}
}
}
show
(
path
:
string
)
{
this
.
http
.
get
(
'
./assets/browser-compat-data
'
+
path
,
{
responseType
:
'
json
'
})
.
subscribe
(
(
data
:
any
)
=>
{
console
.
log
(
data
);
},
()
=>
{
},
()
=>
{
this
.
changePage
.
next
();
});
}
}
src/app/ngfor-object.ts
View file @
5078bd2f
...
...
@@ -13,7 +13,6 @@ export class NgForObjectPipe implements PipeTransform {
keys
.
push
({
key
:
key
,
value
:
data
[
key
]
});
}
}
console
.
log
(
'
<<<
'
,
keys
);
return
keys
;
}
...
...
src/assets/browser-co
n
pat-dat
e
.txt
→
src/assets/browser-co
m
pat-dat
a
.txt
View file @
5078bd2f
File moved
src/assets/update.sh
View file @
5078bd2f
...
...
@@ -2,5 +2,5 @@
#!/bin/bash
cd
browser-compat-data
# find -L **/**.json > '../browser-conpat-date.txt'
find
.
-type
f
\(
-iname
"*.json"
\)
>
'../browser-conpat-date.txt'
\ No newline at end of file
# find -L **/**.json > '../browser-compat-data.txt'
find
.
-type
f
\(
-iname
"*.json"
\)
>
'../browser-compat-data.txt'
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment