我试图在Angular 2中更改iframe内部元素的值.我尝试了很多东西,但我一直无法使用引用项目getElementById().我有一个测试场景,它适用于一个案例,而不是另一个案例,这使我更加困惑:
<iframe #iframe src="assets/test.html"></iframe>
Run Code Online (Sandbox Code Playgroud)
<h1 id="wow">Wow</h1>
Run Code Online (Sandbox Code Playgroud)
<h1 id="wow">Wow<h1>)export class MyComponent implements AfterViewInit {
@ViewChild('iframe') iframe: ElementRef;
ngAfterViewInit() {
var doc = this.iframe.nativeElement.contentDocument;
doc.open();
doc.write('<h1 id="wow">Wow</h1>');
doc.close();
console.log(doc.getElementById("wow"));
}
}
Run Code Online (Sandbox Code Playgroud)
null)export class MyComponent implements AfterViewInit {
@ViewChild('iframe') iframe: ElementRef;
ngAfterViewInit() {
var doc = this.iframe.nativeElement.contentDocument;
console.log(doc.getElementById("wow"));
}
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能让第二个正确打印元素?无论我做什么或放入什么test.html,它总是空的.
DataWeave不喜欢我正在尝试用它做什么,而且我不确定我做错了什么,或者它是否是DataWeave的限制是不可能的.
这是一个场景:我正在查询Salesforce并获得两个值:让我们称之为X和Y.
这是我想要的返回,[{X:Y}, {X2:Y2}, {X3:Y3}, ...]但是使用DataWeave似乎不可能获得像这样的键值对,相反,它似乎只能为脚本中的每个值专门设置Key,如下所示:[{Value_X: X, Value_Y: Y}, {Value_X: X2, Value_Y: Y2}, ...]
这是我当前的DataWeave脚本,但它给了我第二个结果:
%dw 1.0
%output application/java
---
payload map {
Value_X: $.X,
Value_Y: $.Y
}
Run Code Online (Sandbox Code Playgroud)
这是我希望工作的DataWeave脚本,但不是
%dw 1.0
%output application/java
---
payload map {
$.X: $.Y
}
Run Code Online (Sandbox Code Playgroud) 我正在把头发拉出来 - 我正在为SPA设置路由,它对于main页面和我的search页面来说非常棒.但是它对我的services页面根本不起作用,它只显示任何内容.我的网址设置正确,页面肯定是在pages/services.html ..什么给出了什么?
同样,它适用于'/'和'/searchquery'路线,但不是'/servicedependencies'
这是我的文件:
var impact_analysis = angular.module('impact_analysis', ['ngRoute']);
impact_analysis.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'pages/main.html',
controller: 'mainController'
})
.when('/servicedependencies', {
templateURL: 'pages/services.html',
controller: 'serviceController'
})
.when('/searchquery', {
templateUrl: 'pages/search.html',
controller: 'mainController'
});
}]);
impact_analysis.controller('mainController', ['$scope', '$http', function ($scope, $http) {
$scope.search_string = '';
$scope.search_type = '';
$scope.results = [];
$scope.clicked = 0;
$scope.search = function() {
var request = {
method: 'POST',
url: *********,
data: …Run Code Online (Sandbox Code Playgroud)我刚刚设置了一台新计算机——全新的 Java 1.8 安装、新的 3.5.2 Maven 配置,现在我正在设置一个新的快速启动 Maven 项目。
当我添加父 spring boot 启动器和单个依赖项时,无论我做什么,它都无法解决它。
这是跟踪:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.boot:das-boot:1.0-SNAPSHOT: Failure to find org.springframework.boot:spring-boot-starter-parent:pom:1.5.9-RELEASE in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 10, column 11
@
[ERROR] The build could …Run Code Online (Sandbox Code Playgroud)