我使用Node和Gulp安装了Bootstrap 4,运行应用程序时出现以下错误
未捕获的ReferenceError:未定义Popper
到目前为止我只使用了Bootstrap网格系统,而且我没有使用任何需要Bootstrap JS的东西.在我看来像Bootstrap缺少一些东西或我没有正确安装(说实话,这可能是我) - 有没有其他人遇到同样的问题或知道修复?
我一直在使用Visual Studio Code,因为它处于beta版本,而我最喜欢的功能之一是在应用程序中使用Angular CLI的集成终端。自从有了笔记本电脑以来,它的运行状况一直很好,但是由于Xmas中断,我重新安装了Windows 10,因此显然必须重新安装Visual Studio Code。
从那时起,我在终端上遇到了问题,在您按回车键之前,它一直为空白,这时您会看到路径,但没有从Windows命令行获得的通常的版权声明。
到目前为止,我已经尝试了以下方法:
还有什么我可以尝试的吗?还有其他人遇到过同样的问题吗?
我正在Web.Config中修改一个用C#编写的ASP.NET应用程序的会话时间,目前我将超时设置为120分钟,如下所示:
<sessionState mode="InProc" cookieName="Application_SessionId" timeout="120"/>
Run Code Online (Sandbox Code Playgroud)
这个值有限制吗?因此,如果我希望将其设置为24小时(1440分钟),那么这将适用吗?
它是带有MVC 2.0的ASP.NET 4.0版
我希望尝试新的Angular版本(4.1.x),但是Nuget上的Angular包声明这是1.6.x版本 - 它在4月份发布,与Angular 4发布时一致.如果我想使用最新版本的Angular 4,是否有人知道这是否是我正在寻找的包裹?
我有一个 Angular 5 应用程序,我正在尝试使用 Google OAuth 登录来获取用户名,然后在服务中设置该用户名以用作登录用户。在添加登录名之前,我在服务中手动设置了该值,并且没有问题。现在我正在从 Google 登录设置用户名,看起来每次页面刷新(或调用服务的新实例时)我设置的值都会丢失。
该值从 Google 登录正确返回(我在控制台中检查过),所以我知道那里一切正常。我对 Angular 服务的印象是它们在其他模块中保持不变?是不是每次我调用该服务时都会创建一个新的空“tempuser”变量?如果是这样,有什么办法可以解决这个问题,以便我可以在整个应用程序中保留该值,直到用户注销?
这是服务本身:
import { Injectable } from '@angular/core';
import { Http, Response, Headers } from "@angular/http";
@Injectable()
export class WmApiService {
//private _baseUrl = "http://wm-api.webdevelopwolf.com/"; // Test server api
private _baseUrl = "http://localhost:58061/"; // Dev server api
tempuser = "";
tempuseravatar = "";
tempuserfullname = "";
tempuseremail = "";
userloggedin = 0;
modules: any;
constructor(private _http: Http) {
console.log('Wavemaker API Initialized...');
}
// On successful API call …
Run Code Online (Sandbox Code Playgroud) 我在 JavaScript 中有一个基本函数,它只需要一些预设值,然后使用预制函数将它们显示在屏幕上。当我断点我正在做的第一行时,页面加载正常,正如预期的那样,但是一旦我删除了该断点,就没有设置任何信息。并且页面是空白的。
this.QuizSelection = function () {
// Fill the ID's with the right info
app.SetBackground('head', this.HeroImage);
console.log('1 ' + this.HeroImage);
app.LoadInnerHTML('breadcrumbs', 'Home / ' + this.Title);
app.LoadInnerHTML('quizSelectionTitle',this.Title);
console.log('2 ' + this.Title);
app.LoadInnerHTML('quizSelectionIntro',this.Introduction);
console.log('3 ' + this.Introduction);
// Show the Quiz Selection and Heading
app.ShowSection('head');
app.ShowSection('quizSelection');
console.log('Quiz Selection');
}.bind(this);
Run Code Online (Sandbox Code Playgroud)
里面的函数(SetBackground 和 LoadInnerHTML)只是一小行改变内部 html 和设置背景图像的函数。
// Change Inner HTML
this.LoadInnerHTML = function (id, html) {
var d = document.getElementById(id);
d.innerHTML = html;
}
// Set Background Image
this.SetBackground = function …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用接受 String 参数的自定义路由创建一个 Web API 方法,但这在应用程序启动时似乎会出错 - 因此我什至不需要点击该路由或方法来中断应用程序。
// Pass String to TMS and Return an ID
[System.Web.Http.HttpGet]
[System.Web.Http.Route("api/job/import/{import:string}")]
public int TmsImport(string import)
{
var TmsId = 0;
if (import.Length > 0)
{
TmsId = 1;
}
return (TmsId);
}
Run Code Online (Sandbox Code Playgroud)
应用程序中断 Global.asx 中的以下方法:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
Run Code Online (Sandbox Code Playgroud)
当我将 int 传递给该方法时,同样的方法可以工作,但它似乎无法识别参数中的名称“string”。我确实在这里看到了类似问题的答案:call to web api with string parameter - 但我无法弄清楚该答案的变化在哪里?是在 JS 调用中还是在路由配置中?
我有一个 angular 站点,我在其中插入了一些代码以使浏览器后退按钮的行为与后退 UI 按钮的行为相同。但是,当我按回浏览器时,在执行默认行为之前,最后访问的页面会闪烁一秒钟。
这是一个视频来展示我的意思 - 最后我展示了点击 UI 按钮的作用,这是我想要模拟的: 浏览器后退按钮演示
这是我在 Angular 中使用的代码:
@HostListener('window:popstate', ['$event'])
onBrowserBackBtnClose(event: Event) {
// Stop default behavior of the back button
event.stopPropagation();
event.preventDefault();
// If we can go back...
if (this.canGoBack) {
// Load the previous question
this.questionService.previousQuestion().subscribe(res => {
// Activate the question route in place of the previous page
this.router.navigate(['question'], {replaceUrl: true});
});
}
}
Run Code Online (Sandbox Code Playgroud)
我的理解是,event.stopPropagation();
并event.preventDefault();
停止了这种闪烁的行为?或者还有什么我不理解或遗漏的吗?
我希望能够遍历几个不同的标签并根据是否选中单选按钮来隐藏它们的内容。这是我想出的解决方案,但我一直在控制台中收到错误消息。
var hazardOptions = $(".js-hazardous-option");
var hazard = $("input[name=Hazardous]");
for (var i = 0, len = hazard.length; i < len; i++) {
if (hazard[i].id === "HazardousYes" && hazard[i].checked) {
for (var ii = 0, length = hazardOptions.length; ii < length; ii++) {
hazardOptions[ii].show();
}
} else if (hazard[i].id === "HazardousNo" && hazard[i].checked) {
for (var iii = 0, leng = hazardOptions.length; iii < leng; iii++) {
hazardOptions[iii].hide();
}
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
hide() 不是函数
不确定我错过了什么,我试过在网上查看类似的问题,但没有运气。我很确定问题就在这里:hazardOptions[iii].hide();
但不确定为什么和/或如何解决它。
我被告知要管理 .net core 项目上的用户机密,但是 Visual Studio for Mac 中似乎缺少此上下文菜单项?它与窗户在不同的地方吗?或者还有什么额外的东西需要安装等吗?
注意:当我打开项目时,它也没有在项目文件中添加用户秘密 ID 的 XML 行 - 不确定这是否相关?
angular ×3
javascript ×3
jquery ×2
asp.net ×1
bootstrap-4 ×1
c# ×1
google-oauth ×1
nuget ×1
terminal ×1
typescript ×1
web-config ×1