在home.component.html页面中,我希望按钮在单击时将URL重定向到新页面。
我希望当我单击按钮时,当前url http://localhost:24282/home将被重定向到该URL http://localhost:24282/master并master.component.html显示页面。
问题是,尽管http://localhost:24282/master当我单击按钮时将URL重定向到,但是我仍然在当前页面上home.component.html。我没有完全重定向到母版页master.component.html
下面是实现。
应用程序路由
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './Components/home.component';
import { MasterComponent } from './Components/master/master.component';
import { PageNotFoundComponent } from "./Components/common/page-not-found.component";
const appRoutes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'master', component: MasterComponent },
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: '**', component: PageNotFoundComponent } …Run Code Online (Sandbox Code Playgroud) 我开始学习React Native,并发现React Native开发也可以在Windows上完成(感谢UWP).而且,我发现这个博客(https://shift.infinite.red/getting-started-with-react-native-development-for-windows-ba23a4be90b6#.c117cuwmy)详细介绍了如何安装和创建React Native的步骤为Windows开发项目和配置.我正在运行Windows 10,并且已经在"设置"下将开发人员功能设置为开发人员模式.但是,当我尝试初始化Windows(运行react-native windows)时,我收到一条错误消息"找不到react-native-windows@0.41 .. react-native-windows的最新版本是0.40.0-rc.1 ,尝试切换到react-native@0.40 .."(参见下面的屏幕截图)
我将package.json中的react-native依赖项更改为我的项目文件夹下的0.39.1(如博客中所述),但它仍然不起作用.
"dependencies": {
"react": "15.4.2",
"react-native": "0.41.2"
},
Run Code Online (Sandbox Code Playgroud)
这是package.json中的结构
{
"name": "MyFirstProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "15.4.2",
"react-native": "0.41.2"
},
"devDependencies": {
"babel-jest": "18.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "18.1.0",
"react-test-renderer": "15.4.2",
"rnpm-plugin-windows": "^0.2.3"
},
"jest": {
"preset": "react-native"
}
}
Run Code Online (Sandbox Code Playgroud)
CLI windows插件位于rnpm-plugin-windows@0.2.3
我是否错过了导致此错误的重要步骤?任何帮助是极大的赞赏.
我有一个WPF应用程序,刚刚开始学习MVVM模式.
我的目标是在我的应用程序中主窗口有一个按钮.单击此按钮时,另一个窗口(或用户控件)将出现在主窗口的顶部.
这是MainWindow.xaml的代码
<Window x:Class="SmartPole1080.View.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:utilities="clr-namespace:SoltaLabs.Avalon.Core.Utilities;assembly=SoltaLabs.Avalon.Core"
xmlns:userControls="clr-namespace:SoltaLabs.Avalon.View.Core.UserControls;assembly=SoltaLabs.Avalon.View.Core"
xmlns:controls="clr-namespace:WpfKb.Controls;assembly=SmartPole.WpfKb"
xmlns:wpf="clr-namespace:WebEye.Controls.Wpf;assembly=WebEye.Controls.Wpf.WebCameraControl"
xmlns:view="clr-namespace:SmartPole.View;assembly=SmartPole.View"
xmlns:view1="clr-namespace:SmartPole1080.View"
xmlns:behaviors="clr-namespace:SoltaLabs.Avalon.Core.Behaviors;assembly=SoltaLabs.Avalon.Core"
Title="Smart Pole"
WindowStartupLocation="CenterScreen"
Name="mainWindow"
behaviors:IdleBehavior.IsAutoReset="True" WindowState="Maximized" WindowStyle="None">
<Canvas Background="DarkGray">
<!--Main Grid-->
<Grid Width="1080" Height="1920" Background="White" Name="MainGrid"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<StackPanel Background="Black">
<Grid Background="#253341">
<Grid.RowDefinitions>
<RowDefinition Height="5"/>
<RowDefinition Height="*"/>
<RowDefinition Height="5"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="264"/>
</Grid.ColumnDefinitions>
<Grid Grid.Row="1" Grid.Column="1">
<Button Tag="{StaticResource EmergencyImg}" Name="EmergencyButton"
Command="{Binding ShowEmergencyPanel}">
<Image Source="{StaticResource EmergencyImg}" />
</Button>
</Grid>
<!--Emergency Window Dialog-->
<Grid Name="EmergencyPanel">
<view1:EmergencyInfo x:Name="EmergencyInfoPanel"/>
</Grid>
</Grid>
</StackPanel>
</Grid>
<!--Main Grid-->
</Canvas>
Run Code Online (Sandbox Code Playgroud)
这是另一个窗口(用户控件 …
我一直在开发一个使用 Highcharts 绘制数据图表的 Web 应用程序。因此,其中一项要求是,当我将鼠标悬停在图表上时(下面的屏幕截图 - 假设箭头是鼠标光标),一条垂直线将自动显示鼠标光标所在的位置。除此之外,当鼠标光标在图表内横向移动时,垂直线也将沿 x 轴移动。
这是示例图表。
这是我的 highchart 配置脚本
function plotChartData(dataseries, xtitle)
{
myChart = new Highcharts.Chart({
chart: {
renderTo: 'trendspace',
type: 'line',
zoomType: 'xy',
panning: true,
panKey: 'shift',
plotBorderWidth: 1
},
title: {
text: ''
},
legend: {
layout: 'horizontal',
align: 'left',
itemDistance: 10,
borderWidth: 0,
itemMarginTop: 0,
itemMarginBottom: 0,
padding: 20
},
plotOptions: {
series: {
states: {
hover: {
enabled: false
}
},
dataLabels: {
enabled: false,
format: '{y}'
},
allowPointSelect: false
} …Run Code Online (Sandbox Code Playgroud) 我有多个系列的 Highchart,我想在固定位置显示工具提示。我根据此文档跟踪了这个highcharts 演示。不幸的是,根据我编写的配置代码,工具提示没有显示在固定位置。
该图表的 acrosshair设置为true,当我沿 x 轴移动鼠标时显示 y 轴点(下面的屏幕截图)。
在上面的屏幕截图中,我想在绿色框(左上角固定位置)上显示工具提示 CDT158: 188.84和 CDEP158: 151.00 。
这是我的示例配置代码
function plotChartData(dataSeries, xaxisTitle)
{
myChart = new Highcharts.Chart({
chart: {
renderTo: 'chartSpace',
type: 'line',
zoomType: 'xy',
panning: true,
panKey: 'shift',
plotBorderWidth: 1,
events: {
dblclick: function (e) {
window.alert('Hello Chart!')
}
}
},
title: {
text: 'Fixed Tooltip'
},
legend: {
layout: 'horizontal',
align: 'left',
itemDistance: 10,
borderWidth: 0,
itemMarginTop: 0,
itemMarginBottom: 0,
padding: 20
}, …Run Code Online (Sandbox Code Playgroud) 我有一个UWP应用程序,用于捕获和处理来自摄像头的图像.该项目利用Microsoft认知服务人脸识别API,我现在正在探索应用程序的现有功能.我的目标是当相机识别人物的图像时(通过脸部识别API服务),我想显示该人的相关图像.
这样,图像被捕获并存储在我的机器的本地目录中.我想检索图像文件并在识别出人物后在屏幕上呈现它.
下面的代码显示了asyncTask方法ProcessCameraCapture
private async Task ProcessCameraCapture(ImageAnalyzer e)
{
if (e == null)
{
this.UpdateUIForNoFacesDetected();
this.isProcessingPhoto = false;
return;
}
DateTime start = DateTime.Now;
await e.DetectFacesAsync();
if (e.DetectedFaces.Any())
{
string names;
await e.IdentifyFacesAsync();
this.greetingTextBlock.Text = this.GetGreettingFromFaces(e, out names);
if (e.IdentifiedPersons.Any())
{
this.greetingTextBlock.Foreground = new SolidColorBrush(Windows.UI.Colors.GreenYellow);
this.greetingSymbol.Foreground = new SolidColorBrush(Windows.UI.Colors.GreenYellow);
this.greetingSymbol.Symbol = Symbol.Comment;
GetSavedFilePhoto(names);
}
else
{
this.greetingTextBlock.Foreground = new SolidColorBrush(Windows.UI.Colors.Yellow);
this.greetingSymbol.Foreground = new SolidColorBrush(Windows.UI.Colors.Yellow);
this.greetingSymbol.Symbol = Symbol.View;
}
}
else
{
this.UpdateUIForNoFacesDetected();
}
TimeSpan latency = DateTime.Now …Run Code Online (Sandbox Code Playgroud) c# ×2
highcharts ×2
javascript ×2
jquery ×2
uwp ×2
wpf ×2
.net ×1
angular ×1
asp.net-mvc ×1
async-await ×1
mvvm ×1
react-native ×1
windows ×1
xaml ×1