2011-02-11 31 views

回答

6

我正在使用这个@TODO标记并工作。下面是例子:

/** 
* Working with cookies (set/get/delete) 

* @namespace Cookies related methods 
* @TODO serialize javascript object and store in cookie 
*/ 
x.cookie = x.cookie || {}; 

/** 
* Set cookie with name/value and expiration with one year 
* 
* @param {string} name 
* @param {string} value 
* @TODO write this method 
*/ 
x.cookie.set = function(name, value) { 

}; 

您可以添加第一@TODO预设模板是这样的:

<!-- ============================== ToDo summary ======================== --> 
      {! 
       var todos = data.comment.getTag("TODO"); 
      !} 
      <if test="todos.length"> 
       <table class="summaryTable" cellspacing="0" summary="A summary of the TODOs documented in the class {+data.alias+}."> 
        <caption>TODO Summary</caption> 
        <thead> 
         <tr> 
          <th scope="col"></th> 
          <th scope="col">ToDo Description</th> 
         </tr> 
        </thead> 
        <tbody> 
        <for each="todo" in="todos"> 
         <tr> 
          <td class="attributes"> 

          </td> 
          <td class="nameDescription"> 
           {+todo+} 
          </td> 
         </tr> 
        </for> 
        </tbody> 
       </table>     
      </if> 

和第二个,每个方法:

<if test="member.comment.getTag('TODO')[0]"> 
    todo: {+ member.comment.getTag("TODO")[0] +} 
</if> 
+0

我要这个片段添加到class.tmpl?我对吗 ? – 2012-03-20 08:23:02