ክፍለ ጊዜ

የጎን ኣሞሌ 5.5

የተተረጎመው መጠን

በዚህ ምዕራፍ:

  • ስለሚትዩር ክፍለ ጊዜ ይማሩ።
  • ስለሥራ ጀምር ተግባር ይወቁ።
  • ስለትኩስ ኮድ ዳግም ማስገባት ይማሩ።
  • ////

    ////

    ////

    የሚትዩር ክፍል ጊዜ

    ////

    ////

    ////

    ክፍለ ጊዜውን መለወጥ

    ////

     Session.set('pageTitle', 'A different title');
    
    Browser console

    ////

    ////

    <header class="navbar">
      <div class="navbar-inner">
        <a class="brand" href="{{pathFor 'postsList'}}">{{pageTitle}}</a>
      </div>
    </header>
    
    client/views/application/layout.html
    Template.layout.helpers({
      pageTitle: function() { return Session.get('pageTitle'); }
    });
    
    client/views/application/layout.js

    ////

    ////

     Session.set('pageTitle', 'A brand new title');
    
    Browser console

    ////

    Identical Changes

    ////

    ሥራ ጀምር መግቢያ

    ////

    ////

    helloWorld = function() {
      alert(Session.get('message'));
    }
    

    ////

    ////

    ////

     Deps.autorun( function() { console.log('Value is: ' + Session.get('pageTitle')); } );
    Value is: A brand new title
    
    Browser console

    ////

     Session.set('pageTitle', 'Yet another value');
    Value is: Yet another value
    
    Browser console

    ////

    ////

    Deps.autorun(function() {
      alert(Session.get('message'));
    });
    

    ////

    ትኩስ ኮድ ዳግም ማስገባት

    ////

    ////

    ////

     Session.set('pageTitle', 'A brand new title');
     Session.get('pageTitle');
    'A brand new title'
    
    Browser console

    ////

     Session.get('pageTitle');
    'A brand new title'
    
    Browser console

    ////

    ////

    ////

     Session.get('pageTitle');
    null
    
    Browser console

    ////

    ////

    1. ////
    2. ////