刚接受采访.第一个问题问我是什么console.log().我非常自信地回答.再次,
第二个问题是,window.console.log()和之间有什么区别console.log().我无言以对.尝试在Google和Stack Overflow中搜索.我没有找到这样有用的帖子来理解它们之间的区别.
任何想法都非常感谢.
如果我在脚本标记中使用async,则会出现错误,如下所示
<script async src="main.js"></script>
Run Code Online (Sandbox Code Playgroud)
该错误仅显示在chrome上
Uncaught ReferenceError: $ is not defined
Run Code Online (Sandbox Code Playgroud)
如果我从脚本标记中删除了异步,则我的控制台中没有更多错误,一切正常.
你知道为什么会遇到这个问题吗?
编辑
下面的脚本放在head标签内
<!-- JS -->
<script async src="../js/jquery/jquery-1.10.1.min.js"> </script>
<script async src="../js/vendor/modernizr-2.8.2.min.js"></script>
<script async src="../js/asynchronous-resources/2014-06-03-asynchronous-resources.js"></script>
<!-- IE JS -->
<!--[if !IE]><!--><script async src="../js/ie10.js"></script><!--<![endif]-->
Run Code Online (Sandbox Code Playgroud)
main.js被添加到页脚.
<script async src="../js/main.js"></script>
Run Code Online (Sandbox Code Playgroud)
我在stackoverflow上发现了一个类似的问题. 在其他脚本之前异步加载jquery
我不得不改变异步以推迟现在在firefox,chrome和IE9中没有更多问题.
它完全打破了IE8和IE7.如果我使用defer,jQuery就会停止工作.
除了结构之外,我对buildspec.yml和文件之间的区别感到相当困惑。appspec.yml我的构建规范中的阶段命令似乎对部署环境没有太大影响,并且在运行过程(例如安装)时使用哪个 appspec 挂钩之间也存在类似的模糊性。只要该过程发生在需要它的阶段之前,我就看不到阶段之间的差异。(我已阅读规范参考文档;他们大多确认这些阶段的标题是出于其目的,但并不是真正的目的。)
举个例子,为什么每次我必须进行部署时,我不直接使用 Packer 烘焙自己的 AMI,然后启动一个新主机并附加 AMI?
将我的 Angular 从 12.0.2 升级到 13.0.3 后,一切正常。我试图删除一些未使用的软件包,例如jquery,以及其他一些我不记得的软件包等node_modules,之后我删除package-lock.json并运行npm i以再次安装所有软件包。之后我收到了一堆错误,然后我再次恢复了 package.json 并尝试了 npm i 然后我收到了以下错误。我无法修复它。
知道如何解决这个问题吗?
\n./node_modules/@angular/platform-browser/fesm2020/animations.mjs:531:9-31 - Error: export \'\xc9\xb5supportsWebAnimations\' (imported as \'\xc9\xb5supportsWebAnimations\') was not found in \'@angular/animations/browser\' (possible exports: AnimationDriver, \xc9\xb5Animation, \xc9\xb5AnimationEngine, \xc9\xb5AnimationStyleNormalizer, \xc9\xb5NoopAnimationDriver, \xc9\xb5NoopAnimationStyleNormalizer, \xc9\xb5WebAnimationsDriver, \xc9\xb5WebAnimationsPlayer, \xc9\xb5WebAnimationsStyleNormalizer, \xc9\xb5allowPreviousPlayerStylesMerge, \xc9\xb5containsElement, \xc9\xb5invokeQuery, \xc9\xb5validateStyleProperty)\n\n./node_modules/@angular/platform-browser/fesm2020/animations.mjs:531:69-88 - Error: export \'\xc9\xb5CssKeyframesDriver\' (imported as \'\xc9\xb5CssKeyframesDriver\') was not found in \'@angular/animations/browser\' (possible exports: AnimationDriver, \xc9\xb5Animation, \xc9\xb5AnimationEngine, \xc9\xb5AnimationStyleNormalizer, \xc9\xb5NoopAnimationDriver, \xc9\xb5NoopAnimationStyleNormalizer, \xc9\xb5WebAnimationsDriver, \xc9\xb5WebAnimationsPlayer, \xc9\xb5WebAnimationsStyleNormalizer, \xc9\xb5allowPreviousPlayerStylesMerge, \xc9\xb5containsElement, \xc9\xb5invokeQuery, \xc9\xb5validateStyleProperty)\nRun Code Online (Sandbox Code Playgroud)\n … 我只是按照这个 tutplus 教程来获取源地图 sass。
我在 chrome 中的检查元素下的实验选项卡中找不到对 sass选项的支持。被移除了吗?我迟到了使用这个功能吗?
我的 sass 版本是 3.3.8 (Maptastic Maple)
如何在 Chrome Devtools 中进行 SASS 编辑?
使用angular2可以获得*ngFor点击时的当前索引值吗?我有一个客户列表,我想获得他们的索引值.
<button ion-item *ngFor="let customer of customers" (click)="showRadio()">
{{ customer.customer_name }}
</button>
Run Code Online (Sandbox Code Playgroud)
showRadio(currentIndex) {
//................
for(var j=0; j<myResult[currentIndex].bookingIds.length; j++) {
alert.addInput({
type: 'radio',
label: myResult[currentIndex].bookingIds[j],
value: myResult[currentIndex].bookingIds[j],
checked: false
});
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试通过cordova build android. 它在以下位置给了我一个 apk
D:/wamp/www/templateproject/platforms/android/build/outputs/apk/android-debug.apk
当我尝试在我的手机中打开该应用程序时,我收到此警报消息。
Unable to open file android-debug.apk. You do not have an app installed on this device to open this type of file.
注意:我已经检查了来自未知来源的安装。
我如何打开这样的文件?
注意:它似乎适用于我朋友的设备,Redmi note 3但不适用于我的设备,Redmi note 4并且moto g2不确定是什么问题。
我正在使用jade,sass和compass来制作HTML模板.我已经安装了用于jade编译器的nodejs软件来完成命令提示.但它一次只编译单个文件.我想使用命令提示符一次编译所有文件,就像sass和compass一样.我想知道它是否可以通过命令提示符.
注意:我没有使用像Prepros这样的UI软件.
任何帮助将不胜感激.提前致谢.
编辑: -
我在命令提示符下使用下面的命令来编译jade文件.
jade -w index.jade
Run Code Online (Sandbox Code Playgroud) 我只是想将我的 Angular 应用程序从版本 15 更新到 16。一切都适用于 Angular。即使它使角度通用构建也没有错误。但是当我尝试使用npm run serve:ssr它时会抛出错误
类型错误:“instanceof”的右侧不是对象
最初我认为这可能是我的代码中的一些错误,但我删除了整个代码并仅保留具有简单标题的应用程序组件。它仍然抛出同样的错误。
服务器.ts
import { enableProdMode } from "@angular/core";
(global as any).WebSocket = require('ws');
(global as any).XMLHttpRequest = require('xhr2');
import 'zone.js/dist/zone-node';
const domino = require('domino');
const fs = require('fs');
const path = require('path');
import { ngExpressEngine } from '@nguniversal/express-engine';
import * as express from 'express';
import { join } from 'path';
import { existsSync } from 'fs';
const dotenv = require('dotenv');
dotenv.config();
const distFolder = join(process.cwd(), 'dist/project-name/browser');
const template …Run Code Online (Sandbox Code Playgroud) javascript typescript server-rendering angular-universal angular
javascript ×4
angular ×3
android ×1
asynchronous ×1
aws-codestar ×1
cicd ×1
console.log ×1
cordova ×1
html ×1
packer ×1
phonegap ×1
pug ×1
sass ×1
typescript ×1
vimeo ×1