当我将“@ngrx/router-store”添加到我的项目时,它会在开发模式和单元测试结果中向应用程序控制台发送垃圾邮件,并显示以下消息:
状态中不存在功能名称“路由器”,因此 createFeatureSelector 无法访问它。确保使用 StoreModule.forRoot('router', ...) 或 StoreModule.forFeature('router', ...) 将其导入到加载的模块中。如果默认状态是未定义的,如路由器状态的情况,则可以忽略此仅用于开发的警告消息。
我试图将router状态属性类型设置为
router: null | RouterReducerState<SerializedRouterStateSnapshot>
Run Code Online (Sandbox Code Playgroud)
和初始状态值
router: null
Run Code Online (Sandbox Code Playgroud)
但它与routerReducer类型冲突,类型只接受
RouterReducerState<SerializedRouterStateSnapshot>
Run Code Online (Sandbox Code Playgroud)
如何禁用此警告?老实说,我觉得这很烦人。
当我扩展我的base.html.twig我的JS加载两次.这是我的代码:
{% block javascripts %}
{% javascripts
'@MyBundle/Resources/public/app/src/lib/jquery.js'
'@MyBundle/Resources/public/app/src/lib/jquery-ui.js'
'@MyBundle/Resources/public/app/src/lib/angular.js'
'@MyBundle/Resources/public/app/src/lib/ui-bootstrap-tpls-0.10.0.js'
'@MyBundle/Resources/public/app/src/lib/fullcalendar.js'
'@MyBundle/Resources/public/app/calendar.js'
'@MyBundle/Resources/public/app/src/lib/angular-route.js'
'@MyBundle/Resources/public/app/schedulePlanner.js'
%}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
Run Code Online (Sandbox Code Playgroud) 我正在使用AngularJS模块的editable-text指令xeditable.有没有办法禁用整个页面的指令?
我考虑过使用替换editable-text {{variable}},在哪里variable="editable-text"启用和variable="somethingElse"禁用.但是,这会在html中产生无意义的属性.
好,朋友们。我不确定为什么这不起作用。按照老师给我们的一个例子,据我所知,除了函数和变量名称之外,一切都是一样的......使用外部 JavaScript 文件,Dreamweaver 说没有语法错误或其他任何类型的错误,但调试器打开Firefox 说TypeError: document.getElementById(...)[0] is undefined...我不确定为什么,但这是我的代码:
JavaScript :
var caveboyanim = new Array(6);
var curCaveBoy = 0;
for (var i = 0; i < 6; ++i) {
caveboyanim[i] = new Image();
caveboyanim[i].src = "images/caveboy" + i + ".png";
}
function caveboyanimation() {
if (curCaveBoy == 5)
curCaveBoy = 0;
else ++curCaveBoy;
document.getElementById("caveboy")[0].src = caveboyanim[curCaveBoy].src;
}
Run Code Online (Sandbox Code Playgroud)
HTML :
<body onLoad="setInterval('caveboyanimation()', 1000);">
<img src="images/caveboy0.png" id="caveboy" alt="Image of a cave boy">
</body>
Run Code Online (Sandbox Code Playgroud) 嘿伙计们,我完全被这个人困住了.
基本上我想在我的本地开发人员能够看到我的src js文件文件并用babel转换它们并将它们输出到我的dist文件夹然后在完成之后有pm2重启节点加载最新的更改.
我遇到的问题是我不能为我的生活弄清楚如何添加一个回调来监视,以便重启pm2的调用只发生在babel完成魔法转换文件之后.
var gulp = require("gulp");
var babel = require("gulp-babel");
var pm2 = require("pm2");
var watch = require("gulp-watch");
var plumber = require("gulp-plumber");
var SRC = "src/**/*js";
var DIST = "dist/";
function restartPM2() {
//restart pm2 code in here
}
gulp.task("default", function () {
return gulp.src(SRC)
.pipe(watch(SRC))
.pipe(plumber())
.pipe(babel())
.pipe(plumber.stop())
.pipe(gulp.dest(DIST));
// somewhere in here need a call back after babel has transformed
// the code and saved it to dist/ to then call restartPM2
});Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激!
javascript ×4
angular ×1
angularjs ×1
babeljs ×1
gulp ×1
ngrx ×1
pm2 ×1
symfony ×1
typescript ×1
watch ×1