小编jab*_*128的帖子

$ scope是AngularJS中的真实服务吗?

$ scope是AngularJS中的服务还是$ rootScope的实例?

var $injector = angular.element(document).injector();
$injector.get('$rootScope'); //it will return $rootScope  
$injector.get('$scope');  //it will return undefined  
Run Code Online (Sandbox Code Playgroud)

所以我怀疑$ scope不是'真正的'服务.

angularjs angularjs-scope

1
推荐指数
1
解决办法
1155
查看次数

当我使用koajs时,为什么会触发控制台两次

我今天尝试koajs并编写helloworld示例:

/**
* index.js
*/
var koa = require('koa');
var app = koa();

app.use(function*(){
  this.body = 'hello world';
  console.log('success!');
});

app.listen(8080);  
Run Code Online (Sandbox Code Playgroud)

然后我运行index.js文件并在浏览器中访问localhost:8080,但每次刷新页面时,console.log似乎都会触发两次.为什么?

javascript node.js koa

0
推荐指数
1
解决办法
272
查看次数

标签 统计

angularjs ×1

angularjs-scope ×1

javascript ×1

koa ×1

node.js ×1