var result = db.query("select ... ");
//use result
db.query("select ... ", function(result){
//use result
});
puts("enter your name");
var name = gets();
puts("name: " + name);
puts("enter your name");
gets(function (name){
puts("Name: " + name);
});
{
"name": "test",
"version": "1.0.0",
"description": "test",
"main": "app.js",
"keywords":[
"demo"
],
"author": "dev <dev@company.com"> ()",
"license": "ISC"
}
choco install nodejs.install
<body ng-app>
<input ng-model="name">
<p>
Hello {{name}}
</p>
</body>
<script>
function TodoController($scope){
$scope.todos = [
{ name: 'todo1', completed: true},
{ name: 'todo2', completed: false}
];
}
</script>
<body ng-app>
<div ng-controller="TodoController">
<ul>
<li ng-repeat="todo in todos">
<input type="checkbox" ng-model="todo.completed">
{{ todo.name }}
</li>
</ul>
</div>
</body>
allow you to encapsulate parts of your application and reuse them in other places
angular.module('app', [])
.controller('TodoController', ['$scope', function ($scope) {
$scope.todos = [
{ title: 'todo1', completed: true },
{ title: 'todo2', completed: false }
];
}]);