小编Mr *_*xin的帖子

如何修复Angular不使用显式注释,不能在严格模式下调用

我使用严格模式Angular 1.4.7,我收到以下错误:

Error: [$injector:strictdi] function($scope, $element, $attrs, mouseCapture) is not using explicit annotation and cannot be invoked in strict mode
Run Code Online (Sandbox Code Playgroud)

角度生成的错误网址是:

https://docs.angularjs.org/error/ $ injector/strictdi?p0 = function($ scope,%20 $ element,%20 $ attrs,%20mouseCapture

以下是服务

angular.module('mouseCapture', [])

//
// Service used to acquire 'mouse capture' then receive dragging events while the mouse is captured.
//
.factory('mouseCapture', function ($rootScope) {

    //
    // Element that the mouse capture applies to, defaults to 'document' 
    // unless the 'mouse-capture' directive is used.
    //
    var $element …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-directive

34
推荐指数
2
解决办法
4万
查看次数

如何在postgresql中使用timezone更新datetime字段

正如问题所述,我试过了

UPDATE mytable set end_date="2015-07-17 22:00:00+00" WHERE id=8244;
Run Code Online (Sandbox Code Playgroud)

但是由于显而易见的原因,这不起作用,网络上的所有细节都是关于搜索没有更新它们的日期,特别是当它们有时区时

postgresql

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

如何使用docker-compose在docker上安装gulp

我正在使用docker compose,这是我的yaml文件

web:
  dockerfile: Dockerfile-dev
  build: .
  command: gulp
  volumes:
    - .:/app
  ports:
    - '9001:9001'
Run Code Online (Sandbox Code Playgroud)

这是我的docker文件

FROM node:0.12.7

RUN npm install -g bower gulp

ADD . /app
WORKDIR /app

RUN bower install --allow-root
Run Code Online (Sandbox Code Playgroud)

然后我跑了

docker-compose -f docker-compose-dev.yml build
docker-compose -f docker-compose-dev.yml up
Run Code Online (Sandbox Code Playgroud)

但我得到以下错误

Recreating web_web_1...
Attaching to web_web_1
web_1 | [07:39:08] Local gulp not found in /app
web_1 | [07:39:08] Try running: npm install gulp
web_web_1 exited with code 1
Gracefully stopping... (press Ctrl+C again to force)**strong text**
Run Code Online (Sandbox Code Playgroud)

我尝试在RUN …

docker gulp boot2docker dockerfile docker-compose

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

如何让 django runserver 停止登录到 pycharm 中的控制台

这是我的记录器设置

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,

    'handlers': {
        # Send all messages to console
        'console': {
            'level': 'INFO',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose',
        },

    },
    'loggers': {
         '': {
            'handlers': ['console'],
            'level': 'INFO',
            'propagate': True,
        },
    },
}
Run Code Online (Sandbox Code Playgroud)

我已经在 Django 中配置了日志记录,但是我的日志淹没在前端生成的连续 GET、POST、PUT 请求中,即我不想看到这样的来自 django 的日志

[08/Jul/2015 11:05:59] "GET /home/ HTTP/1.1" 200 910
Run Code Online (Sandbox Code Playgroud)

只有我的日志来自

logger = logging.getLogger(__name__)
logger.info('Hello world')
Run Code Online (Sandbox Code Playgroud)

有没有办法让 letrunserver 不显示请求而只显示来自我的记录器的日志

我忘了在 pycharm 中提到这一点

这对其他选项没有影响

--verbosity 0
Run Code Online (Sandbox Code Playgroud)

这在其他选项中

 > dev/null
Run Code Online (Sandbox Code Playgroud)

给出这个错误

CommandError: Usage is runserver [optional port number, or …
Run Code Online (Sandbox Code Playgroud)

python django pycharm

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