[英]socket.io console.log(userName) not showing in the command line
[英]Write console.log() to the command line in AngularJS
除非您在phantomJS之類的無頭瀏覽器中運行javascript或在node中執行它,否則這並不容易。
console.log()
在chrome或firefox等瀏覽器的控制台中顯示,因為它們“執行”了您的代碼。 Grunt只是建立您的javascript文件..不執行它們
您的命令行代表您的服務器-您需要在服務器端代碼(或適合后端的任何語言console.log()
中運行console.log()
)。
這對其他人可能是盲目的,但是對於Angular的初學者來說,當我調用console.log()時,我期望在node.js服務器窗口中看到輸出,但是實際上輸出顯示在Web控制台中。
對於Firefox:漢堡菜單,Web開發人員,Web控制台(或Ctrl-Shift-K)
對於Chrome:漢堡菜單,更多工具,開發者工具,然后在右側窗格中選擇控制台標簽。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.