Category: "Q&A"
Meteor Collection Skip and Limit
To pagination of reccords, Skip and Limit on a MongoDB collection is a "must" . "Skip" is to set the starting point of collection, "Limit" is to set the end point of Collection. That is very easy
Code
Customers.find({},{skip:10,limit:10}) |
Just like that!
Angular 2 is not Server Side Technology.
Yesterday, I went to Angular hackday in Brisbane.That is very good and informative. I learned a lot. However, a lot of people asked how do I bind the data object to an angular page. I think that is a good question. I asked myself before; we can do similar action in asp.net MVC. Angular 2 required being compiled into a package to be browser It looks more similar to a server script that a javascript framework.
Angular 2 is an MVVM framework. It only deals with ViewModel. This design is completely separated to be view logic from the server, put them in the browser. The application logic is in the service layer where connects to database. Angular two will run on Browser. Between those two layers will communicate by JSON. The architecture showed in the diagram.
Foreach in Java
I used foreach keyword in C#. I used it to travel element one by one in a list. In Java, there is not such keyword calls foreach. But you can use for to do that:
E.g.
Code
for(Tag tag : tags){ | |
tag.getName(); | |
} |