我有两个接口;
interface ISuccessResponse {
Success: boolean;
Message: string;
}
Run Code Online (Sandbox Code Playgroud)
和
interface IAppVersion extends ISuccessResponse {
OSVersionStatus: number;
LatestVersion: string;
}
Run Code Online (Sandbox Code Playgroud)
我想将ISuccessResponse接口扩展为Not Required; 我可以覆盖它,但还有其他选择吗?
interface IAppVersion {
OSVersionStatus: number;
LatestVersion: string;
Success?: boolean;
Message?: string;
}
Run Code Online (Sandbox Code Playgroud)
我不想这样做.
我在SPA中阅读了Google跟踪代码管理器v4 - 入门并将Google跟踪代码管理器和Google Analytics集成
即使我可以,我也不确定它在Javascript方面的处理方式.所以我想在原生方面处理.但谷歌的文档有点令人困惑.我对Cordova和GTM文章一无所知.有什么想法吗?还是一步一步指导?
javascript android google-analytics cordova google-tag-manager
我的目标是创建一个像"/ sdcard/files/excel /"或"/ sdcard/files/pdf /"这样的文件夹.后面的部分sdcard
来自url("/ files/excel").首先,我想检查"/ files/excel"是否存在,然后创建一个文件(如果它也不存在).该名称来自名为"localFileName"的url.
在这种情况下,folder ="files/excel"和localFileName ="Sheet1.html".
在fs.root.getDirectory行之后,我得到了名为FileError.PATH_EXISTS_ERR的错误12,但sdcard中没有文件夹或文件.
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
var folder = file_path.substring(0,file_path.lastIndexOf('/'));
console.log(folder);
fs.root.getDirectory(folder,{create: true, exclusive: false},function (datadir) {
console.log(folder);
datadir.getFile(localFileName, {create: true, exclusive: false},function(fileEntry) {
var ft = new FileTransfer();
yol = "/sdcard/"+folder+localFileName;
ft.download( remoteFile,yol,function(entry) {
console.log(entry.fullPath);
}, fail);
}, fail);
}, fail);
}, fail);
Run Code Online (Sandbox Code Playgroud) 使用Eclipse.SDK Manager是最新的.然而,当我将facebook SDK导入我的工作区时.它会引发很多错误.
facebook-android-sdk-4.0.0\facebook\res\values\messenger_button_styles.xml:66: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'.
我从值中删除了它.
The import android.support cannot be resolved
我添加了支持v4
'<>' operator is not allowed for source level below 1.7
如果我改变编译器它会给kitkat下面的错误.当我这样做insert inferred type arguments
它消失了.然后它给出了螺栓库错误.然后我下载了螺栓并导入它.这次螺栓怎么能提供很多我无法进一步修复的东西.任何建议.
我有一个名为'Signature'的活动,我从CordovaPlugin调用它;
Plugin.java
public boolean execute(String action, JSONArray args,
CallbackContext callbackContext) throws JSONException
{
Intent i = new Intent(context, Signature.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
cordova.startActivityForResult(this,i,90);
}
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
Log.d(TAG, "activity result in plugin: requestCode(" + requestCode + "), resultCode(" + resultCode + ")");
if(requestCode == 90) {
if (resultCode == this.cordova.getActivity().RESULT_OK) {
Bundle res = intent.getExtras();
String result = res.getString("results");
Log.d("FIRST", "result:"+result);
this.callbackContext
.success(result.toString());
} else {
this.callbackContext.error("Error");
}
}
Run Code Online (Sandbox Code Playgroud)
Signature.java
private void finishWithResult(String result,int status)
{ …
Run Code Online (Sandbox Code Playgroud) 我有一个字符串;
String uA = "Mozilla/5.0 (iPad; CPU OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12D508 Twitter for iPhone";
String[] a= {"iphone","ipad","ipod"};
Run Code Online (Sandbox Code Playgroud)
它必须返回,ipad
因为ipad在字符串的第一个匹配ipad.在其他情况下
String uA = "Mozilla/5.0 (iPhone/iPad; CPU OS 8_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12D508";
Run Code Online (Sandbox Code Playgroud)
相同的字符串数组首先匹配iPhone
.
我在JS上有很多有用的代码片段。像cl
对console.log();
或
fn
对于
function methodName (arguments) {
// body...
}
Run Code Online (Sandbox Code Playgroud)
但是我不能在*.ts
文件上使用它们。
如何还可以管理js到TS的代码段和组合。
谢谢
android ×3
cordova ×3
javascript ×3
typescript ×2
c# ×1
callback ×1
compare ×1
directory ×1
eclipse ×1
facebook ×1
file ×1
interface ×1
java ×1
sublimetext3 ×1
user-agent ×1