Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ng-template-generator
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
ng-template-generator
Commits
29d0fc7d
Commit
29d0fc7d
authored
Sep 17, 2019
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改展现问题
parent
c1ca728f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
form.component.ts
src/app/form/form.component.ts
+11
-14
index.html
src/index.html
+7
-3
No files found.
src/app/form/form.component.ts
View file @
29d0fc7d
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnChanges
,
OnInit
,
Output
}
from
'
@angular/core
'
;
import
{
Component
,
EventEmitter
,
Input
,
OnDestroy
,
OnChanges
,
OnInit
,
Output
,
ApplicationRef
}
from
'
@angular/core
'
;
import
*
as
_
from
'
lodash
'
;
@
Component
({
...
...
@@ -24,25 +24,22 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
teststr
=
""
;
constructor
()
{
constructor
(
private
appRef
:
ApplicationRef
)
{
}
ngOnInit
()
{
var
_this
=
this
;
setTimeout
(()
=>
{
this
.
titleObj
.
content
=
"
Hello world!!!
"
;
this
.
teststr
=
"
************
"
},
2000
);
// (<any>window).courseware.getData(function(data){
// if(data){
// _this.titleObj.content = data.content;
// }
// });
}
let
_this
=
this
;
(
<
any
>
window
).
courseware
.
getData
(
function
(
data
){
if
(
data
){
_this
.
titleObj
=
data
;
_this
.
appRef
.
tick
();
}
});
}
ngOnChanges
()
{
}
ngOnDestroy
()
{
...
...
src/index.html
View file @
29d0fc7d
...
...
@@ -33,7 +33,7 @@
}
});
},
setData
:
function
(
data
,
callback
){
setData
:
function
(
data
,
callback
){
let
str
=
JSON
.
stringify
(
data
);
net
.
getData
(
"
setCoursewareData
"
,{
id
:
id
,
data
:
str
},
function
(
res
){
if
(
res
){
...
...
@@ -58,11 +58,15 @@
}
else
{
return
{
getData
:
function
(
callback
){
let
data
=
localStorage
.
getItem
(
"
courseware_data
"
);
let
data
=
localStorage
.
getItem
(
"
courseware_data
"
);
if
(
data
){
data
=
JSON
.
parse
(
data
);
}
callback
&&
callback
(
data
);
},
setData
:
function
(
data
,
callback
){
localStorage
.
setItem
(
"
courseware_data
"
,
data
);
console
.
log
(
"
******local********
"
);
localStorage
.
setItem
(
"
courseware_data
"
,
JSON
.
stringify
(
data
));
callback
&&
callback
();
}
}
...
...
Write
Preview
Markdown
is supported
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