The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

505970 (10) [Avatar] Offline
While going through chapter 4 Templates I see that originalNumberOfBooks is camel case in the view-model but in the view it is cabob case with the (dot) .one time. why is it cabob case and not just all lowercase or camel case?

Thank you,
Sean Hunter (29) [Avatar] Offline
Thanks for the feedback. This should be consistent. I'll review the listings around that and correct for the upcoming MEAP smilie.

505970 (10) [Avatar] Offline
I think the listings are correct. Typescript throws a compile error if it is any other way then cabob case, I was just wondering way that is? Is that the convention for multiple word attributes?
Sean Hunter (29) [Avatar] Offline
Ah yes, my apologies. I didn't read this correctly.

Aurelia uses InitCase within view-models and kebab-case in view templates. The naming convention is described here:!/book/aurelia-in-action/chapter-3/v-5/point-663-56-56-0

505970 (10) [Avatar] Offline
I think there may be some confusion. I'm not referring to the file naming convention. in book-stats we have a property named originalNumberOfBooks like bellow
import {computedFrom, bindable} from 'aurelia-framework';
export class BookStats{
  @bindable books;
  @bindable originalNumberOfBooks;
  @computedFrom('originalNumberOfBooks', 'books.length')
  get addedBooks(){
      return this.books.length—this.originalNumberOfBooks;

then in books.html we bind to it as bellow
<require from="./book-stats"></require>
<book-stats if.bind="books.length > 0"

Then my question is why is the binding instead of or is the kebob case in the html a convention and so should be followed for multi-worded properties?

when trying both or I get a build error specifying to try the original-number-of-books instead.
Sean Hunter (29) [Avatar] Offline
Ah ok yes that makes sense, apologies for the delayed reply.

Generally, the convention indicates that everything should be kebab-case in the view with the exception of when you have a JavaScript expression in you binding (for example: click.delegate="removeBook($index)").