在测试我的UserRouter时,我使用的是json文件
data.json
[
{
"id": 1,
"name": "Luke Cage",
"aliases": ["Carl Lucas", "Power Man", "Mr. Bulletproof", "Hero for Hire"],
"occupation": "bartender",
"gender": "male",
"height": {
"ft": 6,
"in": 3
},
"hair": "bald",
"eyes": "brown",
"powers": [
"strength",
"durability",
"healing"
]
},
{
...
}
]
Run Code Online (Sandbox Code Playgroud)
构建我的应用程序,我得到以下TS错误
ERROR in ...../UserRouter.ts
(30,27): error TS7006: Parameter 'user' implicitly has an 'any' type.
Run Code Online (Sandbox Code Playgroud)
UserRouter.ts
import {Router, Request, Response, NextFunction} from 'express';
const Users = require('../data');
export class UserRouter {
router: Router;
constructor() {
... …Run Code Online (Sandbox Code Playgroud) func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {}
Run Code Online (Sandbox Code Playgroud)
我想deviceToken串
但:
let str = String.init(data: deviceToken, encoding: .utf8)
Run Code Online (Sandbox Code Playgroud)
str 是 nil
swift 3.0
我怎么才能让data来string?
在Xcode 8/Swift 3.0中注册推送通知? 没有工作,答案是几个月前,我曾尝试过:
并打印:
我正在开发的应用程序在模拟器或手机中调试得很好,但是当我尝试构建 apk 时,出现以下错误:
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':image_picker_android:debugUnitTestRuntimeClasspath'.
> Failed to transform bcprov-jdk15on-1.68.jar (org.bouncycastle:bcprov-jdk15on:1.68) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /home/cicada/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.68/46a080368d38b428d237a59458f9bc915222894d/bcprov-jdk15on-1.68.jar.
> Failed to transform '/home/cicada/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.68/46a080368d38b428d237a59458f9bc915222894d/bcprov-jdk15on-1.68.jar' using Jetifier. Reason: IllegalArgumentException, message: Unsupported class file major version 59. (Run with --stacktrace …Run Code Online (Sandbox Code Playgroud) 我想写一个简单的正则表达式来检查给定的字符串是否存在任何特殊字符.我的正则表达式有效,但我不知道为什么它也包含所有数字,所以当我输入一些数字时它会返回错误.
我的代码:
//pattern to find if there is any special character in string
Pattern regex = Pattern.compile("[$&+,:;=?@#|'<>.-^*()%!]");
//matcher to find if there is any special character in string
Matcher matcher = regex.matcher(searchQuery.getSearchFor());
if(matcher.find())
{
errors.rejectValue("searchFor", "wrong_pattern.SearchQuery.searchForSpecialCharacters","Special characters are not allowed!");
}
Run Code Online (Sandbox Code Playgroud) 我根本不认识詹金斯。我想在 Windows 10 上安装 Jenkins。我下载了安装程序并运行了它,但我遇到了问题。我不知道在“服务登录凭据”阶段的“帐户”和“密码”字段中输入什么。
如果我使用 Windows 帐户的用户名和密码(具有管理员权限),则会显示以下信息:
在以后的实施,我能够成功地证实,谷歌机器人可以通过Android Studio中的测试指标我的应用程序(工具>安卓>谷歌应用程序索引测试).根据Google Search Console,我的应用已超过200页被编入索引.但这里遵循问题
如果已安装该应用,则点击Google搜索结果即可打开该应用.但如果未安装该应用程序,则会转到该网站(即搜索结果中没有安装按钮).
Firebase的所有其他工作原理:应用邀请,深层链接,分析.
所以我问,有没有人实际上有Firebase应用程序索引工作?如果是这样,真的怎么样?
我的应用程序是一个带有Spinner的Activity,用户通过从微调器中选择一个项目来选择内容.并且当用户做出选择时填充片段.当然要索引,我AppIndex.AppIndexApi.start(client, getAction())在填充Fragment时调用,AppIndex.AppIndexApi.end(client, getAction())当用户选择不同的内容时调用...并重复start-end.
而不是使用Digital Asset Links我通过我的应用程序与我的网站关联Search Console.
我最近从Ionic 2升级到了Ionic 3,我创建了components.module.ts文件并声明并导出了我拥有的每个自定义组件,然后在我拥有的每个页面模块中导入了这个单个文件.
所以现在问题是我不能在我自己的组件中使用ion-*组件,因为我没有导入IonicModule.forRoot(..)我的components.module里面.
错误是:
"模板解析错误:'ion-spinner'不是已知元素......"
我究竟做错了什么?
我正在尝试使用SMS INDIA HUB API向用户发送一次性密码.为此,我需要重定向到URL格式:
如果我们加载此URL,它将返回一些消息.我需要得到那条消息.
我试过这样的
$url = "http://cloud.smsindiahub.in/vendorsms/pushsms.aspx?user=wwww&password=eee&msisdn=9197xxxxx&sid=yyyyy&msg=rrrrr&fl=0&gwid=2";
return Redirect::intended($url);
Run Code Online (Sandbox Code Playgroud)
但它没有指向那个链接.它尝试在localhost中加载该URL.
或者有没有使用SMS INDIA HUB发送短信的插件?
谁能帮忙?
我可以在View上设置EditorFor控件的宽度吗?
我设置了一些参数:
[Required, DisplayName("Payee Name"), StringLength(50)]
public string Name { get; set; }
Run Code Online (Sandbox Code Playgroud)
但是,我似乎无法设置渲染的文本框的宽度.
<table width="300" border="0" cellpadding="3" cellspacing="0">
<tr>
<td>
<%=Html.LabelFor(m => m.Name)%>
</td>
<td>
<%=Html.EditorFor(m => m.Name)%>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
这可以以某种方式完成吗?
我试过了:
<%=Html.EditorFor(m => m.Name, new {width=50)%>
Run Code Online (Sandbox Code Playgroud)
但没有快乐......
我将服务定义为类,如下所示:
@Injectable()
export class MyService {
...
}
Run Code Online (Sandbox Code Playgroud)
在其他组件或页面中,我只使用import命令导入该类.
import { MyService } from '../pages/services/myservice';
Run Code Online (Sandbox Code Playgroud)
在构造函数中:
constructor(public _MyService: MyService)
Run Code Online (Sandbox Code Playgroud)
在我的主app.module.ts中,我已将该类服务添加为提供者.
providers: [someOtherThings, MyService, someOtherThings]
Run Code Online (Sandbox Code Playgroud)
在Ionic 2中,事情按预期工作.服务是单身人士.
但是在使用角度4的Ionic 3中,看起来每个组件都在创建该类的新实例.
是否有一些在角度4中创建单例服务类的新方法?