Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 如何让livereload为angular应用程序工作?_Angularjs_Gruntjs - Fatal编程技术网

Angularjs 如何让livereload为angular应用程序工作?

Angularjs 如何让livereload为angular应用程序工作?,angularjs,gruntjs,Angularjs,Gruntjs,我正在尝试运行grunt livereload以获得一个简单的角度应用程序。这是GrunFile中的部分: watch: { livereload: { files: [ '*.{html,js}', 'static/{,*/}*.{css,js,png,jpg,gif,svg}' ], tasks

我正在尝试运行grunt livereload以获得一个简单的角度应用程序。这是GrunFile中的部分:

watch: {
            livereload: {
                files: [
                    '*.{html,js}',
                    'static/{,*/}*.{css,js,png,jpg,gif,svg}'
                ],
                tasks: ['jshint'],
                options: {
                    livereload: LIVERELOAD_PORT
                }
            }
        },
所有文件(js、html)都在rootdirectory中。当我运行“grunt服务器--force”时,我得到一个错误,页面无法显示?我怎样才能解决这个问题,让livereload工作

此外,当我运行“grunt服务器”时,我还得到:

Warning: Object function createServer() {
  function app(req, res, next){ app.handle(req, res, next); }
  merge(app, proto);
  merge(app, EventEmitter.prototype);
  app.route = '/';
  app.stack = [];
  return app;
} has no method 'static' Use --force to continue.

plunkr:

更新您的package.json并使用grunt contrib connect的
0.11.0
版本。它应该可以工作。

您是否在html中包含livereload脚本?请澄清
grunt服务器
?如果这是一个grunt任务列表,那么各个任务是否单独工作?是否运行了npm安装?或者删除您的node_modules文件夹并运行npm安装。