记录器中间件抛出" TypeError:无法读取属性' NullLogger'未定义"

时间:2018-01-20 01:33:07

标签: angular

angular cli没有创建组件,它只是控制台这条消息

无法读取属性' NullLogger'未定义的

4 个答案:

答案 0 :(得分:24)

试试这个:<html> <head> </head> <body> <table> <tr> <th>h</th> <th>D</th> </tr> <tr> <td>Hi</td> <td>Hello</td> </tr> </table> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("td").click(function(){ var $th = $(this).closest('table').find('th').eq($(this).index()); console.log($th.text() + '=' + $(this).text()); $.ajax({ data: $th.text() + '=' + $(this).text(), url: 'url_where_php_is_located.php', method: 'POST', // or GET success: function(msg) { alert(msg); } }); }); }); </script> </body></html> 在你的package.json目录中。

答案 1 :(得分:3)

我认为这可能是Angular CLInpm版本的问题,所以请尝试:

npm install npm@latest -g

npm install @angular/cli@latest --save

注意:您可能需要使用npm安装sudo

sudo npm install npm@latest -g

答案 2 :(得分:1)

在Windows中,卸载和安装angular cli(使用npm)并没有为我解决这个问题。 我通过卸载节点v8并降级到节点v6来解决它。然后采用最新的角度cli版本。

答案 3 :(得分:0)

npm install --save @ angular / cli @ latest 这有效但我必须以管理员的身份调出我的命令窗口。