小编Sam*_*ath的帖子

角度“必须导入或本地”错误

我试图创建一个离子应用程序,当我在离子创建器中将页面链接在一起时,.ts文件出现错误,如下所示:

 typescript: src/pages/home/home.ts, line: 4 
            Individual declarations in merged declaration 'HomePage' must be all exported or all local. 

       L3:  import { NotificationsPage } from '../notifications/notifications';
       L4:  import { HomePage } from '../home/home';
       L5:  import { MyPatientsPage } from '../my-patients/my-patients';
Run Code Online (Sandbox Code Playgroud)

以下是我的.ts文件中的代码:

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { NotificationsPage } from '../notifications/notifications';
import { HomePage } from '../home/home';
import { MyPatientsPage } from '../my-patients/my-patients';
import { AllPatientsPage } from '../all-patients/all-patients';
import { LoginPage } …
Run Code Online (Sandbox Code Playgroud)

typescript ionic-framework ionic3 angular

2
推荐指数
1
解决办法
8993
查看次数

使用SCSS动态添加blockquote图像

你能告诉我如何使用动态添加blockquote图像SCSS吗?

注意:

svg在这条路上有图像:assets/icon/left-quote.svg

这就是我需要的.

在此输入图像描述

在这里,您可以看到它来自后端(即blockquote标签).

在此输入图像描述

html css sass ionic3

2
推荐指数
1
解决办法
79
查看次数

firebase.firestore.FieldValue.serverTimestamp() 不支持 Timestamp 数据类型

 async createUser(uid: string, email: string) {
    await this.afs.doc<UserProfileModel>(FirestoreDbConstant.USER_PROFILES + `/${uid}`).set({
      email,
      createdDate: firebase.firestore.FieldValue.serverTimestamp(),
    });
  }
Run Code Online (Sandbox Code Playgroud)

这个模型有效

export interface UserProfileModel {
    email: string;
    createdDate?: firebase.firestore.FieldValue;
}
Run Code Online (Sandbox Code Playgroud)

但是为什么我不能Timestamp像这样在这里使用?

import { Timestamp } from '@firebase/firestore-types';

export interface UserProfileModel {
    email: string;
    createdDate?: Timestamp;
}
Run Code Online (Sandbox Code Playgroud)

然后它给出了这个错误:

(property) UserProfileModel.createdDate?: Timestamp Type 'FieldValue' 缺少来自类型 'Timestamp' 的以下属性:seconds, nanoseconds, toDate, toMillists(2739) user-profile.model.ts(11, 5): 预期的类型来自属性“createdDate”,它在“UserProfileModel”类型上声明

这里的问题是我需要toDate()在模板上使用。但它不适用于 createdDate?: firebase.firestore.FieldValue;

<p>{{invitedEvent.startDatetime.toDate() | amDateFormat: 'MMM DD'}}</p>
Run Code Online (Sandbox Code Playgroud)

firebase typescript angular google-cloud-firestore

2
推荐指数
2
解决办法
1427
查看次数

基于 Observable 的 paramMap 方法的用例

我通常在我的应用程序的路线上使用这种方式。

ngOnInit() {
  let id = this.route.snapshot.paramMap.get('id');

  this.hero$ = this.service.getHero(id);
}
Run Code Online (Sandbox Code Playgroud)

但在上面的文档中我也可以看到基于 Observable 的方法。

ngOnInit() {
  this.hero$ = this.route.paramMap.pipe(
    switchMap((params: ParamMap) =>
      this.service.getHero(params.get('id')))
  );
}
Run Code Online (Sandbox Code Playgroud)

你能告诉我为什么我们需要这种方法吗?医生这样说

使用此技术您只能获得参数映射的初始值。如果路由器有可能重用该组件,请坚持使用可观察的 paramMap 方法。

但我不清楚。你能告诉我为什么我们需要基于 Observable 的方法吗?

rxjs typescript angular angular-router

2
推荐指数
1
解决办法
885
查看次数

为jquery选择器选择标签

<%: Html.CompleteEditorFor(m => m.PetSitterRestrictionPermission.OffLimitAreas)%>
Run Code Online (Sandbox Code Playgroud)

以上生成的代码如下

<label for="PetSitterRestrictionPermission_OffLimitAreas">Off-limit areas</label>
<input id="PetSitterRestrictionPermission_OffLimitAreas" class="text-box single-line" type="text" value="area" name="PetSitterRestrictionPermission.OffLimitAreas" style="display: none;">
<span id="PetSitterRestrictionPermission_OffLimitAreas_validationMessage" class="field-validation-message"></span>
Run Code Online (Sandbox Code Playgroud)

如何label从上面的代码中选择以获得一些jquery效果(作为选择器)?

css jquery asp.net-mvc-2

1
推荐指数
1
解决办法
8177
查看次数

Paypal Ipn与asp.net MVC集成

HomeControler/Index.cshtml页面如下

<div id="paypalDiv">

        <form id="paypalForm" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
            <fieldset>
                <p class="inline-small-label" style="padding-top: 7px;">
                    <label for="device-id"><span>User ID</span></label></p>

                <input id="custom" class="full-width" type="text" name="custom" value="">
                <input class="full-width" type="hidden" name="business" value="sampath-facilitator@inexisconsulting.com">
                <input type="hidden" name="cmd" value="_xclick">
                <input type="hidden" name="item_name" value="credits">
                <input type="hidden" name="item_number" value="40">
                <input type="hidden" name="amount" value="2.95">
                <input type="hidden" name="no_shipping" value="1">
                <input type="hidden" name="return" value="http://localhost:13769">
                <input type="hidden" name="notify_url" value="https://localhost:13769/Home/Ipn">
                <button class="btn btn-primary submit-button" type="submit">Pay with PayPal</button>
            </fieldset>

        </form>
    </div>
Run Code Online (Sandbox Code Playgroud)

HomeControler/Ipn Action方法如下

public ActionResult Ipn()
{
    // Receive IPN request from PayPal and parse all the …
Run Code Online (Sandbox Code Playgroud)

c# paypal paypal-ipn asp.net-mvc-4

1
推荐指数
1
解决办法
6438
查看次数

在下拉框中设置默认选定项目

我需要将第一个选定的项目设置为下拉框的索引1.我该怎么做?

我尝试了类似下面的内容.但我需要在不使用硬编码值的情况下这样做(即没有'Day Camp').

 //for set default values
                    $("#ddlServiceCategoryType option").each(function () {
                        if ($(this).text() == 'Day Camp') {
                            $(this).attr('selected', 'selected');
                            return false;
                        }
                    });
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

HTML

<select id="ddlServiceCategoryType" name="ServiceCategoryTypeViewModel.ServiceCategoryType.Id" class="has_sb" style="display: block;"><option value="">-Please select a service category-</option>
<option value="1">Day Camp</option>
<option value="2">Boarding</option>
<option value="3">Pet Sitting</option>
<option value="4">Grooming</option>
</select>
Run Code Online (Sandbox Code Playgroud)

jquery

1
推荐指数
1
解决办法
3148
查看次数

带有 ng-if 的正则表达式

  <div class="row" ng-if="MyTest.Item.MyPassword != MyTest.Item.ConfirmPassword">
       <div class="col-md-12">
      <p class="red-color"> Password must be between 4 and 8 digits long and include at least one numeric digit And Passwords must match! </p>
        </div>
 </div>
Run Code Online (Sandbox Code Playgroud)

当“Mypassword != ConfirmPassword”和正则表达式 '/^(?=.*\d).{4,8}$/' 不符合密码字段时,我需要显示上述消息。如何使用正则表达式与 ng-if ?任何帮助将不胜感激。

regex angularjs

1
推荐指数
1
解决办法
1万
查看次数

尝试替换空字符串时无法识别的转义序列

string serverPath = Regex.Replace(mytext, "\Api", "", RegexOptions.IgnoreCase);

mytext=D:\Trunck\Api\web\Resources\images\event-images\e1ae04a2-e63f-4831-a5ee-2f0d2713f8a2.png
Run Code Online (Sandbox Code Playgroud)

我怎么能代替\api空字符串或者我需要一个最终mytextD:\Trunck\web\Resources\images\event-images\e1ae04a2-e63f-4831-a5ee-2f0d2713f8a2.png

当我使用上面的正则表达式时,它说Unrecognized escape sequence.任何帮助都将受到高度赞赏.

c# regex

1
推荐指数
1
解决办法
385
查看次数

从今天开始的一个月与momentjs

你能告诉我如何从今天开始1个月的日期与moment.js.

我试过下面的一个.

 myDate = moment().add(1, 'months');
Run Code Online (Sandbox Code Playgroud)

结果格式是 Fri Jun 26 2015 00:13:48 GMT+0530

但我需要这样的格式06/26/2015.所以我该怎么做?提前致谢.

javascript momentjs

1
推荐指数
1
解决办法
4979
查看次数