我为什么要......
未捕获的TypeError:string.split不是函数
......当我跑...
var string = document.location;
var split = string.split('/');Run Code Online (Sandbox Code Playgroud)
我有一个表格,我用CKEditor替换我<textarea>的(多个).我想在提交表单之前从页面中删除所有CKEditor实例.我怎么能做到这一点?
我看过删除CKEdit实例,但它根本没有帮助我.
注意:我的所有CKEditor都有一个类"ckedit"
任何人都可以了解我将如何立即取消订阅RxJS订阅?可观测量来自Angular 2 EventEmitter.当我收到活动时,我想取消订阅.这里的问题是在功能块中取消订阅.我觉得这是错误的做法:
this.subscription = observable.subscribe(result => {
// do something
// **unsubscribe**
});
Run Code Online (Sandbox Code Playgroud) 我将Angular 4项目文件夹从拍卖生活重命名为拍卖05生活,并将以下三个旧项目名称替换为:
然后我跑了ng serve,得到了这个:
你似乎不依赖于"@ angular/core".这是一个错误.
编辑:按照下面评论中的说明,我重新启动终端窗口,确保我在正确的项目文件夹auction-05-life,npm install然后运行ng serve,这次有一个不同的例外:
module.js:471
throw err;
^
Error: Cannot find module 'heimdalljs-logger'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
...
Run Code Online (Sandbox Code Playgroud) 我必须解码JSON Extjs 4:
我已经使用过Ext.decode(string, true),但是它不起作用'因为我的字符串是一个带有JSON字符串(转义)的JSON ......就像这样:
var string = '{
success: true,
rows: [{
"id": 33,
"defaultset": 1,
"name": "Generico",
"jsonfields": "[{\"name\":\"cm:addressees\",\"title\":\"Destinatari\",\"description\":\"Destinatari\",\"dataType\":\"d:text\",\"url\":\"\/api\/property\/cm_addressees\"}]",
"eliminato": 0
}]
}';
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,该字段jsonfields是一个JSON字符串.我用的时候
Ext.decode(string, true);
Run Code Online (Sandbox Code Playgroud)
什么都不会发生错误.
有什么建议?
我正在尝试重新创建类似于此的东西.我注意到输入字段不能在里面,<ion-content class="padding">因为它们会得到一个难看的填充.另一方面,按钮需要这个衬垫,否则它会粘在一边而没有任何衬垫.
以下代码不起作用,因为它将按钮放在输入字段的顶部:
<ion-view view-title="Settings">
<div ng-controller="ClickedCtrl">
<ion-content>
<div class="list">
<label class="item item-input item-floating-label">
<span class="input-label">First Name</span>
<input type="text" placeholder="First Name" ng-mode="fname">
</label>
</div>
</ion-content>
<ion-content class="padding">
<button class="button button-positive" ng-click="clicked()">
Save
</button>
</ion-content>
</div>
</ion-view>
Run Code Online (Sandbox Code Playgroud)
更新:
这个布局是我想要的(注意输入字段没有填充,但按钮上有填充):

我正在为所有 Angular 5 项目设置一个通用库。库是 GitHub 存储库Angular-library-starter-kit的克隆。
一切正常,直到我尝试使用HttpClientModule(的继承者HttpModule)。
以下是我的library.module.ts文件的内容:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HttpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
import { MyService } from './my-service';
export * from './my-service';
@NgModule({
imports: [
CommonModule,
HttpModule,
HttpClientModule
],
exports: [
],
declarations: [
],
providers: [
MyService
],
})
export class LibraryModule { }
Run Code Online (Sandbox Code Playgroud)
以下是my-service.ts(这是库中唯一的文件)的内容:
import { Injectable …Run Code Online (Sandbox Code Playgroud) 我在旧系统上运行我的 Ionic 应用程序,该系统不能很好地处理动画,因此我尝试禁用它们。
我尝试opts在创建模态时设置为:
{
cssClass: 'plain-modal',
enableBackdropDismiss: false,
enterAnimation: 'no-animation',
leaveAnimation: 'no-animation',
showBackdrop: true
}
Run Code Online (Sandbox Code Playgroud)
似乎no-animation在这里没有效果。它实际上并不应用于任何 DOM 元素。或者是吗?
在诊断时,我注意到 Ionic.content在模态即将打开或关闭时应用内联 CSS:
transform: translateX(100%);
will-change: transform, -webkit-transform;
transition-duration: 500ms;
transition-timing-function: cubic-bezier(0.36, 0.66, 0.04, 1);
Run Code Online (Sandbox Code Playgroud)
所以我尝试使用以下方法覆盖那些initial !important:
.show-page.plain-modal {
> ion-backdrop {
opacity: 0.5; // Nothing is displayed if I don't do this
}
> .modal-wrapper {
opacity: 1; // Again nothing is displayed if I don't do this
> .ion-page { …Run Code Online (Sandbox Code Playgroud) 在 ProcessRecord{3c67ecf8080:com.example/u0a171} android.os.TransactionTooLargeException 中引发启动活动异常:数据包大小 572488 字节
传递数据
Intent intent = new Intent(activity, SearchListActivity.class);
intent.putExtra(HRConstants.SEARCHLIST, searchResponse);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
获取数据
Intent intent = getIntent();
searchResponse = intent.getParcelableExtra(HRConstants.SEARCHLIST);
searchLists = searchResponse.getSearchResults();
Run Code Online (Sandbox Code Playgroud)
我minSdkVersion15 岁,targetSdkVersion26 岁。
响应包含 1736 个项目,后跟一个异常。它适用于较少的项目。