偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Clouda第一App“留言大廳”之創(chuàng)建hall.js

移動開發(fā) Android
Clouda是簡單,可依賴的實時Javascript框架。對一個想開發(fā)移動webapp的開發(fā)者來說,可以使用clouda開發(fā)框架,實現(xiàn)一個功能和體驗與native app齊平的輕應(yīng)用。

首先預(yù)覽一下"留言大廳"

在"留言大廳"這個應(yīng)用中,用戶可以在這里留言,也可以看到別人的留言。

因為需要存儲留言,所以在正式開始之前我們需要先安裝MongoDB,并在127.0.0.1的27017端口上啟動(此地址可在 app/server_config/database.js中進行配置),MongoDB是我們依賴的數(shù)據(jù)庫,在以后各種應(yīng)用中都會經(jīng)常用到。

app/view/下創(chuàng)建hall.html

  • hall.html

    1. <style> 
    2.     button{width:100px; height:40px;} 
    3.     #content{width:360px;height:300px;margin-top:10px;} 
    4. </style> 
    5. <div align="center"
    6.     <h1>Clouda message Hall</h1> 
    7.     <input style="height:40px; width:260px;padding-left: 5px;" id="messageInput" placeholder="Say Something Now:"/> 
    8.     <button class="messageSubmit">submit</button> <br/> 
    9.  
    10.     <block tpl-id="message-hall"
    11.         <textarea readonly="readonly" id="content"
    12.             {{#each data}} 
    13.             {{this.content}} 
    14.             {{/each}} 
    15.         </textarea><br/> 
    16.     </block> 
    17.  
    18.     <button class="clearHistory">clear history</button> 
    19. </div> 

    與上一篇文檔中我們看到的View不同,這次hall.html中多了"{{this.content}}",這是插入模板渲染所需的數(shù)據(jù)變量,Clouda使用handlebars組件作為模板引擎,關(guān)于handlebars語法請查看handlebars官網(wǎng)。

至此,App代碼部分已經(jīng)完成。

責(zé)任編輯:張葉青
相關(guān)推薦

2013-10-31 15:32:29

CloudaApp

2013-10-31 15:16:13

CloudaApp

2013-10-31 15:29:47

CloudaApp

2013-10-31 15:27:25

CloudaApp

2013-10-31 15:40:44

CloudaApp

2013-10-31 15:47:29

CloudaApp

2013-10-31 11:04:03

Cloudapackage.js

2013-10-31 15:12:57

CloudaAPI

2013-10-30 22:10:28

Clouda程序

2013-10-30 22:41:23

Clouda環(huán)境

2013-10-31 10:57:10

CloudaManifest

2013-10-31 09:51:10

CLouda結(jié)構(gòu)

2013-10-31 14:55:22

2013-10-31 13:47:23

CloudaAPI

2013-10-31 14:30:44

CloudaAPI

2013-10-31 10:59:41

Clouda使用

2013-10-30 22:50:30

Clouda結(jié)構(gòu)

2013-12-09 17:27:19

CloudaNode.js

2013-10-31 13:37:07

CloudaAPI手冊

2013-10-31 22:53:58

Clouda程序
點贊
收藏

51CTO技術(shù)棧公眾號