我需要使用nodeJS运行一个shell脚本文件,该文件执行一组Cassandra DB命令.任何人都可以帮我这个
在db.sh文件中.
create keyspace dummy with replication = {'class':'SimpleStrategy','replication_factor':3}
create table dummy (userhandle text, email text primary key , name text,profilepic)
Run Code Online (Sandbox Code Playgroud) 我正在构建一个 next.js 页面/page/data/[dataId]
(当用户单击 page 中的链接时导航该页面/page/data
,我通过 API 获取项目列表)。
当用户单击按钮时,我调用 API 来从数据库中删除该项目。一旦API调用成功。我需要将用户重定向回/page/data
页面。我是这样做的:
async function removeData(){
// ... some logic
await removeData({input});
setTimeout(()=>{
router.push("/page/data"); // redirecting to parent
},2000)
}
Run Code Online (Sandbox Code Playgroud)
一旦用户被重定向回,/page/data/
我需要刷新数据项列表,因为我想删除已删除的项目。现在的问题是 -/page/data/
浏览后没有刷新 router.push
。
我知道我们可以通过替换来实现这一点,router.push
但这window.location="/page/data"
是非常昂贵的方式。
我也尝试过:
router.push("/page/data",undefined,{shallow:false})
Run Code Online (Sandbox Code Playgroud)
但没有成功。
任何人都可以帮助我,我们怎样才能以最佳方式实现这一目标?我发现window.location
这种方法太昂贵了。
我正在使用Material UI Framework创建新的Angular 4应用程序.我按照以下步骤操作:https://material.angular.io/guide/getting-started .
但是,当我在'npm start'时,它无法编译并说:
ERROR in /home/programoholic/workspace/heroapp/src/app/app.module.ts (3,10): Module '"/home/programoholic/workspace/heroapp/node_modules/@angular/material/material"' has no exported member 'MaterialModule'
.
错误截图:
这是我的Package.Json文件:
{
"name": "heroapp",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^4.2.4",
"@angular/cdk": "^2.0.0-beta.11",
"@angular/common": "^4.2.4",
"@angular/compiler": "^4.2.4",
"@angular/core": "^4.2.4",
"@angular/forms": "^4.2.4",
"@angular/http": "^4.2.4",
"@angular/material": "^2.0.0-beta.11",
"@angular/platform-browser": "^4.2.4",
"@angular/platform-browser-dynamic": "^4.2.4",
"@angular/router": "^4.2.4",
"core-js": "^2.4.1", …
Run Code Online (Sandbox Code Playgroud) 我们可以将 node_modules 存储到公共文件夹而不是本地存储库文件夹(node_modules),然后将此公共文件夹用于 angular 项目吗?我将通过流程图解释我的要求:
我知道强烈建议我们将依赖项本地放置在 node_modules 文件夹中,以便更快、更可靠地加载它们。但我仍然试图创建一个包含本地模块的公共本地存储库(如 maven 中的 m2)。
首先,这是个好主意吗?(在我看来,如果我能够做到这一点,CD 过程将从 20-25 分钟减少到 2-3 分钟)[我们执行干净构建因此代理从存储库中清除本地更改,因此npm install
是必需的]
所有依赖都是固定版本(不自动升级)
如何配置 npm 将包存储到公共文件夹而不是本地 node_modules
如何将公共存储库中存在的包导入到我的 angular 代码库中
谁可以帮我这个事 。??
continuous-integration npm node-modules package.json angular
我需要从 jar 文件中替换单个类文件。jar 文件相当大,每次我都不想提取它并手动替换。我想自动化这个过程。有人可以帮我解决这个问题吗?提取 jar 文件后,会创建以下文件夹:
我需要进入“com/cgp/f1/cmmi/”文件夹并替换其中的类文件。
我尝试过的事情:
zip file.jar com/cgp/f1/cmmi/services.class Services.class
jar uf file.jar com/cgp/f1/cmmi/ services.class
jar -uf file.jar com\cgp\f1\cmmi\ services.class
jar uf file.jar com/cgp/f1/cmmi/services.class services.class
我收到的错误是:
使用 jar 命令
com\cgp\f1\cmmi\ 时:没有这样的文件或目录使用 zip 命令时:
zip 警告:名称不匹配:com\cgp\f1\cmmi\Services.class
有人可以指导我哪里出错了吗?
我正在尝试将 Angular 下拉列表(Angular 4+)与 10000 多条记录绑定,它挂起应用程序,我们无法执行任何其他操作。
我只是使用 *ngFor,同样的
<select class="form-control browser-default col-md-12" name="attributeName" [(ngModel)]="attributeName">
<option *ngFor="let item of typeArray" [ngValue]="item">
{{item}}
</option>
</select>
Run Code Online (Sandbox Code Playgroud)
我也尝试过 ng2-auto-complete 和 ng2-completer 等解决方案,但是当我开始输入时,应用程序挂起,因为数据很大。还有其他可行的解决方案吗?
我想要部署我的 Angular 项目,但它丢失了组件
步骤1:
我执行cmd:
ng-build --prod
Run Code Online (Sandbox Code Playgroud)
第2步:
我在 IIS 中添加网站,路径位于dist内
步骤3:
索引页面工作正常但未找到其他组件登录 404
http://localhost/login HTTP 错误 404.0 - 未找到
在文件App.Module.Ts中我配置路由
const routesConfig:Routes=
[
{path:"kinds",component:KindsComponent},
{path:"",component:FilmsComponent},
{path:"films",component:FilmsComponent},
{path:"login",component:LoginComponent},
{path:"accounts",component:AccountsComponent},
{path:"customers",component:CustomersComponent},
{path:"director",component:DirectorComponent}
];
Run Code Online (Sandbox Code Playgroud)
再次注意: http://localhost工作正常,但当我构建项目并在 IIS 中部署时找不到其他组件
怎样才能发挥作用呢?我的错误在哪里?
我尝试用 IndexedDB 为一家小书店编写一个有角度的应用程序。\n我将索引“isbn”设置为唯一,现在我尝试引发错误,因为我想告诉用户 isbn 必须是唯一的并想显示错误消息。
\n\n我可以console.log(e)并获得以下输出:
\n\n事件
\n\n {isTrusted: true, type: "error", \n target: IDBRequest, currentTarget: IDBRequest, eventPhase: 2, \xe2\x80\xa6}\n\nisTrusted: true\ntype: "error"\ntarget: IDBRequest\nresult: undefined\n
Run Code Online (Sandbox Code Playgroud)\n\n\n\n\n错误:DOMException:无法将键添加到索引“isbn”:至少有一个键不满足唯一性要求。
\n
问题:
\n\n我无法编写console.log(e.target.error)因为 TypeScript 说:\nTS2339: 类型 \'EventTarget\' 上不存在属性 \'error\'
\n\n为什么?
\n\n#\n\n这是方法:
\n\n新增项目() {
\n\nconst request = window.indexedDB.open(this.database.name);\n\nrequest.onsuccess = event => {\n\n const item = {\n title: \'\',\n isbn: 1,\n descrition: \'\',\n rating: 1\n };\n\n const transaction = request.result.transaction([\'books\'], \'readwrite\');\n …
Run Code Online (Sandbox Code Playgroud) angular ×5
typescript ×2
autocomplete ×1
batch-file ×1
build ×1
cassandra ×1
cmd ×1
dropdownbox ×1
iis ×1
indexeddb ×1
jar ×1
java ×1
next-router ×1
next.js ×1
node-modules ×1
node.js ×1
npm ×1
package.json ×1
performance ×1
reactjs ×1
shell ×1