EditComponent.html 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <!doctype html>
  2. <html class="no-js" lang="">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="ie=edge">
  6. <title>app-angular documentation</title>
  7. <meta name="description" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9. <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
  10. <link rel="stylesheet" href="../styles/style.css">
  11. </head>
  12. <body>
  13. <div class="navbar navbar-default navbar-fixed-top visible-xs">
  14. <a href="../" class="navbar-brand">app-angular documentation</a>
  15. <button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
  16. </div>
  17. <div class="xs-menu menu" id="mobile-menu">
  18. <div id="book-search-input" role="search">
  19. <input type="text" placeholder="Type to search">
  20. </div>
  21. <nav>
  22. <ul class="list">
  23. <li class="title">
  24. <a href="../">app-angular documentation</a>
  25. </li>
  26. <li class="divider"></li>
  27. <li class="chapter">
  28. <a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
  29. <ul class="links">
  30. <li class="link">
  31. <a href="../" ><span class="fa fa-file-text-o"></span>README</a>
  32. </li>
  33. <li class="link">
  34. <a
  35. href="../overview.html"
  36. href="../overview.html"
  37. >
  38. <span class="fa fa-th"></span>Overview
  39. </a>
  40. </li>
  41. </ul>
  42. </li>
  43. <li class="chapter">
  44. <a data-type="chapter-link" href="./modules.html" >
  45. <span class="fa fa-archive"></span>
  46. <span>Modules</span>
  47. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  48. data-target="#xs-modules-links"
  49. ></span>
  50. </a>
  51. <ul class="links collapse in"
  52. id="xs-modules-links"
  53. >
  54. <li class="link">
  55. <a href="../modules/AppModule.html" >AppModule</a>
  56. </li>
  57. <li class="link">
  58. <a href="../modules/LessonModule.html" >LessonModule</a>
  59. </li>
  60. </ul>
  61. </li>
  62. <li class="chapter">
  63. <div class="simple">
  64. <span class="fa fa-cogs"></span>
  65. <span>Components</span>
  66. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  67. data-target="#xs-components-links"
  68. ></span>
  69. </div>
  70. <ul class="links collapse in"
  71. id="xs-components-links"
  72. >
  73. <li class="link">
  74. <a href="../components/AppComponent.html" >AppComponent</a>
  75. </li>
  76. <li class="link">
  77. <a href="../components/BblComponent.html" >BblComponent</a>
  78. </li>
  79. <li class="link">
  80. <a href="../components/DetailComponent.html" >DetailComponent</a>
  81. </li>
  82. <li class="link">
  83. <a href="../components/EcharsComponent.html" >EcharsComponent</a>
  84. </li>
  85. <li class="link">
  86. <a href="../components/EchartsExempleComponent.html" >EchartsExempleComponent</a>
  87. </li>
  88. <li class="link">
  89. <a href="../components/EditComponent.html" class="active" >EditComponent</a>
  90. </li>
  91. <li class="link">
  92. <a href="../components/FlowfatherComponent.html" >FlowfatherComponent</a>
  93. </li>
  94. <li class="link">
  95. <a href="../components/FlowtestComponent.html" >FlowtestComponent</a>
  96. </li>
  97. <li class="link">
  98. <a href="../components/HomeComponent.html" >HomeComponent</a>
  99. </li>
  100. <li class="link">
  101. <a href="../components/NavTabsComponent.html" >NavTabsComponent</a>
  102. </li>
  103. <li class="link">
  104. <a href="../components/PageMineComponent.html" >PageMineComponent</a>
  105. </li>
  106. <li class="link">
  107. <a href="../components/PageSpotDetailComponent.html" >PageSpotDetailComponent</a>
  108. </li>
  109. </ul>
  110. </li>
  111. <li class="chapter">
  112. <div class="simple">
  113. <span class="fa fa-file-code-o"></span>
  114. <span>Classes</span>
  115. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  116. data-target="#xs-classes-links"
  117. ></span>
  118. </div>
  119. <ul class="links collapse in"
  120. id="xs-classes-links"
  121. >
  122. <li class="link">
  123. <a href="../classes/TestChatCompletion.html" >TestChatCompletion</a>
  124. </li>
  125. </ul>
  126. </li>
  127. <li class="chapter">
  128. <div class="simple">
  129. <span class="fa fa-long-arrow-down"></span>
  130. <span>Injectables</span>
  131. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  132. data-target="#xs-injectables-links"
  133. ></span>
  134. </div>
  135. <ul class="links collapse in"
  136. id="xs-injectables-links"
  137. >
  138. <li class="link">
  139. <a href="../injectables/DataServiceService.html" >DataServiceService</a>
  140. </li>
  141. </ul>
  142. </li>
  143. <li class="chapter">
  144. <div class="simple">
  145. <span class="fa fa-info"></span>
  146. <span>Interfaces</span>
  147. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  148. data-target="#xs-interfaces-links"
  149. ></span>
  150. </div>
  151. <ul class="links collapse in"
  152. id="xs-interfaces-links"
  153. >
  154. <li class="link">
  155. <a href="../interfaces/TestChatMessage.html" >TestChatMessage</a>
  156. </li>
  157. </ul>
  158. </li>
  159. <li class="chapter">
  160. <div class="simple">
  161. <span class="fa fa-plus"></span>
  162. <span>Pipes</span>
  163. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  164. data-target="#xs-pipes-links"
  165. ></span>
  166. </div>
  167. <ul class="links collapse in"
  168. id="xs-pipes-links"
  169. >
  170. <li class="link">
  171. <a href="../pipes/TokPipe.html" >TokPipe</a>
  172. </li>
  173. </ul>
  174. </li>
  175. <li class="chapter">
  176. <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
  177. </li>
  178. <li class="divider"></li>
  179. <li class="copyright">
  180. Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
  181. <img src="..//images/compodoc-vectorise.svg" class="img-responsive">
  182. </a>
  183. </li>
  184. </ul>
  185. </nav>
  186. </div>
  187. <div class="container-fluid main">
  188. <div class="row main">
  189. <div class="hidden-xs menu">
  190. <nav>
  191. <ul class="list">
  192. <li class="title">
  193. <a href="../">app-angular documentation</a>
  194. </li>
  195. <li class="divider"></li>
  196. <div id="book-search-input" role="search">
  197. <input type="text" placeholder="Type to search">
  198. </div>
  199. <li class="chapter">
  200. <a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
  201. <ul class="links">
  202. <li class="link">
  203. <a href="../" ><span class="fa fa-file-text-o"></span>README</a>
  204. </li>
  205. <li class="link">
  206. <a
  207. href="../overview.html"
  208. href="../overview.html"
  209. >
  210. <span class="fa fa-th"></span>Overview
  211. </a>
  212. </li>
  213. </ul>
  214. </li>
  215. <li class="chapter">
  216. <a data-type="chapter-link" href="./modules.html" >
  217. <span class="fa fa-archive"></span>
  218. <span>Modules</span>
  219. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  220. data-target="#modules-links"
  221. ></span>
  222. </a>
  223. <ul class="links collapse in"
  224. id="modules-links"
  225. >
  226. <li class="link">
  227. <a href="../modules/AppModule.html" >AppModule</a>
  228. </li>
  229. <li class="link">
  230. <a href="../modules/LessonModule.html" >LessonModule</a>
  231. </li>
  232. </ul>
  233. </li>
  234. <li class="chapter">
  235. <div class="simple">
  236. <span class="fa fa-cogs"></span>
  237. <span>Components</span>
  238. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  239. data-target="#components-links"
  240. ></span>
  241. </div>
  242. <ul class="links collapse in"
  243. id="components-links"
  244. >
  245. <li class="link">
  246. <a href="../components/AppComponent.html" >AppComponent</a>
  247. </li>
  248. <li class="link">
  249. <a href="../components/BblComponent.html" >BblComponent</a>
  250. </li>
  251. <li class="link">
  252. <a href="../components/DetailComponent.html" >DetailComponent</a>
  253. </li>
  254. <li class="link">
  255. <a href="../components/EcharsComponent.html" >EcharsComponent</a>
  256. </li>
  257. <li class="link">
  258. <a href="../components/EchartsExempleComponent.html" >EchartsExempleComponent</a>
  259. </li>
  260. <li class="link">
  261. <a href="../components/EditComponent.html" class="active" >EditComponent</a>
  262. </li>
  263. <li class="link">
  264. <a href="../components/FlowfatherComponent.html" >FlowfatherComponent</a>
  265. </li>
  266. <li class="link">
  267. <a href="../components/FlowtestComponent.html" >FlowtestComponent</a>
  268. </li>
  269. <li class="link">
  270. <a href="../components/HomeComponent.html" >HomeComponent</a>
  271. </li>
  272. <li class="link">
  273. <a href="../components/NavTabsComponent.html" >NavTabsComponent</a>
  274. </li>
  275. <li class="link">
  276. <a href="../components/PageMineComponent.html" >PageMineComponent</a>
  277. </li>
  278. <li class="link">
  279. <a href="../components/PageSpotDetailComponent.html" >PageSpotDetailComponent</a>
  280. </li>
  281. </ul>
  282. </li>
  283. <li class="chapter">
  284. <div class="simple">
  285. <span class="fa fa-file-code-o"></span>
  286. <span>Classes</span>
  287. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  288. data-target="#classes-links"
  289. ></span>
  290. </div>
  291. <ul class="links collapse in"
  292. id="classes-links"
  293. >
  294. <li class="link">
  295. <a href="../classes/TestChatCompletion.html" >TestChatCompletion</a>
  296. </li>
  297. </ul>
  298. </li>
  299. <li class="chapter">
  300. <div class="simple">
  301. <span class="fa fa-long-arrow-down"></span>
  302. <span>Injectables</span>
  303. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  304. data-target="#injectables-links"
  305. ></span>
  306. </div>
  307. <ul class="links collapse in"
  308. id="injectables-links"
  309. >
  310. <li class="link">
  311. <a href="../injectables/DataServiceService.html" >DataServiceService</a>
  312. </li>
  313. </ul>
  314. </li>
  315. <li class="chapter">
  316. <div class="simple">
  317. <span class="fa fa-info"></span>
  318. <span>Interfaces</span>
  319. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  320. data-target="#interfaces-links"
  321. ></span>
  322. </div>
  323. <ul class="links collapse in"
  324. id="interfaces-links"
  325. >
  326. <li class="link">
  327. <a href="../interfaces/TestChatMessage.html" >TestChatMessage</a>
  328. </li>
  329. </ul>
  330. </li>
  331. <li class="chapter">
  332. <div class="simple">
  333. <span class="fa fa-plus"></span>
  334. <span>Pipes</span>
  335. <span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
  336. data-target="#pipes-links"
  337. ></span>
  338. </div>
  339. <ul class="links collapse in"
  340. id="pipes-links"
  341. >
  342. <li class="link">
  343. <a href="../pipes/TokPipe.html" >TokPipe</a>
  344. </li>
  345. </ul>
  346. </li>
  347. <li class="chapter">
  348. <a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
  349. </li>
  350. <li class="divider"></li>
  351. <li class="copyright">
  352. Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
  353. <img src="..//images/compodoc-vectorise.svg" class="img-responsive">
  354. </a>
  355. </li>
  356. </ul>
  357. </nav>
  358. </div>
  359. <div class="content component">
  360. <div class="content-data">
  361. <ol class="breadcrumb">
  362. <li>Components</li>
  363. <li>EditComponent</li>
  364. </ol>
  365. <ul class="nav nav-tabs" role="tablist">
  366. <li class="active">
  367. <a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
  368. </li>
  369. <li>
  370. <a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
  371. </li>
  372. </ul>
  373. <div class="tab-content">
  374. <div class="tab-pane fade active in" id="infos"><p class="comment">
  375. <h3>File</h3>
  376. </p>
  377. <p class="comment">
  378. <code>src/modules/lesson/detail/edit/edit.component.ts</code>
  379. </p>
  380. <section>
  381. <h3>Metadata</h3>
  382. <table class="table table-sm table-hover">
  383. <tbody>
  384. <tr>
  385. <td class="col-md-3">selector</td>
  386. <td class="col-md-9"><code>app-edit</code></td>
  387. </tr>
  388. <tr>
  389. <td class="col-md-3">styleUrls</td>
  390. <td class="col-md-9"><code>edit.component.scss</code></td>
  391. </tr>
  392. <tr>
  393. <td class="col-md-3">templateUrl</td>
  394. <td class="col-md-9"><code>edit.component.html</code></td>
  395. </tr>
  396. </tbody>
  397. </table>
  398. </section>
  399. <section>
  400. <h3 id="constructor">Constructor</h3>
  401. <table class="table table-sm table-bordered">
  402. <tbody>
  403. <tr>
  404. <td class="col-md-4">
  405. <code>constructor(dataService: <a href="../injectables/DataServiceService.html" >DataServiceService</a>)</code>
  406. </td>
  407. </tr>
  408. </tbody>
  409. </table>
  410. </section>
  411. <section>
  412. <h3 id="methods">Methods</h3>
  413. <table class="table table-sm table-bordered">
  414. <tbody>
  415. <tr>
  416. <td class="col-md-4">
  417. <b><span class="modifier"></span> upload</b>
  418. </td>
  419. </tr>
  420. <tr>
  421. <td class="col-md-4">
  422. <span class="modifier-icon method fa fa-play ">
  423. <span class="fa fa-"></span>
  424. </span>
  425. <code>upload()</code>
  426. </td>
  427. </tr>
  428. <tr>
  429. <td class="col-md-4">
  430. <div class="io-description">
  431. <b>Returns: </b> <code>void</code>
  432. </div>
  433. </td>
  434. </tr>
  435. </tbody>
  436. </table>
  437. <table class="table table-sm table-bordered">
  438. <tbody>
  439. <tr>
  440. <td class="col-md-4">
  441. <b> saveFormData</b>
  442. </td>
  443. </tr>
  444. <tr>
  445. <td class="col-md-4">
  446. <code>saveFormData()</code>
  447. </td>
  448. </tr>
  449. <tr>
  450. <td class="col-md-4">
  451. <div class="io-description">
  452. <b>Returns: </b> <code>void</code>
  453. </div>
  454. </td>
  455. </tr>
  456. </tbody>
  457. </table>
  458. </section>
  459. <section>
  460. <h3 id="inputs">Properties</h3>
  461. <table class="table table-sm table-bordered">
  462. <tbody>
  463. <tr>
  464. <td class="col-md-4">
  465. <b> formData</b>
  466. </td>
  467. </tr>
  468. <tr>
  469. <td class="col-md-4">
  470. <code>formData: <code>{ name: string; weight: string; height: string; gender: string; }</code>
  471. </bcode>
  472. </td>
  473. </tr>
  474. </tbody>
  475. </table>
  476. </section>
  477. </div>
  478. <div class="tab-pane fade tab-source-code" id="source">
  479. <pre><code class="hljs javascript">import { Component } from &#x27;@angular/core&#x27;;
  480. import { DataServiceService } from &#x27;../data-service.service&#x27;;
  481. import * as Parse from &quot;parse&quot;
  482. (Parse as any).serverURL &#x3D; &quot;http://metapunk.cn:9999/parse&quot;
  483. Parse.initialize(&quot;dev&quot;)
  484. @Component({
  485. selector: &#x27;app-edit&#x27;,
  486. templateUrl: &#x27;./edit.component.html&#x27;,
  487. styleUrls: [&#x27;./edit.component.scss&#x27;]
  488. })
  489. export class EditComponent {
  490. async upload() {
  491. let YourClass &#x3D; Parse.Object.extend(&quot;Profile&quot;);
  492. let yourObject &#x3D; new YourClass();
  493. yourObject.set({ &quot;name&quot;: this.formData.name, &quot;weight&quot;: this.formData.weight, &quot;height&quot;: this.formData.height, &quot;gender&quot;: this.formData.gender });
  494. yourObject.save().then((result: any) &#x3D;&gt; {
  495. console.log(&quot;数据上传成功&quot;, result);
  496. }).catch((error: any) &#x3D;&gt; {
  497. console.error(&quot;数据上传失败&quot;, error);
  498. });
  499. }
  500. formData &#x3D; {
  501. name: &#x27;&#x27;,
  502. weight: &#x27;&#x27;,
  503. height: &#x27;&#x27;,
  504. gender: &#x27;&#x27;
  505. };
  506. constructor(private dataService: DataServiceService) { }
  507. saveFormData() {
  508. localStorage.setItem(&#x27;formData&#x27;, JSON.stringify(this.formData));
  509. }
  510. }
  511. </code></pre>
  512. </div>
  513. </div>
  514. </div><div class="search-results">
  515. <div class="has-results">
  516. <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
  517. <ul class="search-results-list"></ul>
  518. </div>
  519. <div class="no-results">
  520. <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
  521. </div>
  522. </div>
  523. </div>
  524. </div>
  525. </div>
  526. <script src="../js/libs/bootstrap-native.js"></script>
  527. <script src="../js/libs/es6-shim.min.js"></script>
  528. <script src="../js/libs/EventDispatcher.js"></script>
  529. <script src="../js/libs/promise.min.js"></script>
  530. <script src="../js/libs/zepto.min.js"></script>
  531. <script src="../js/compodoc.js"></script>
  532. <script src="../js/search/search.js"></script>
  533. <script src="../js/search/lunr.min.js"></script>
  534. <script src="../js/search/search-lunr.js"></script>
  535. <script src="../js/menu.js"></script>
  536. <script src="../js/libs/highlight.pack.js"></script>
  537. <script src="../js/libs/highlightjs-line-numbers.min.js"></script>
  538. <script src="../js/search/search_index.js"></script>
  539. <script>
  540. document.addEventListener('DOMContentLoaded', function() {
  541. hljs.initHighlightingOnLoad();
  542. hljs.initLineNumbersOnLoad();
  543. });
  544. </script>
  545. </body>
  546. </html>