我需要在我的C#代码中使用Delphi DLL.
使用具有公共参数的其他方法时我取得了一些成功,但在这种情况下,解决方案仍然隐藏.
DLL文档提供了此声明:
Function Get_Matrix (var Matrix : array [ 1..200 ] of char) : boolean ; stdcall;
Run Code Online (Sandbox Code Playgroud)
我试着用:
[DllImport("DLL.dll")]
public static extern bool Get_Matrix(ref char[] Matrix);
Run Code Online (Sandbox Code Playgroud)
不成功.一些帮助?
我有一个HTTP资源,它返回数据库中前10个实体的JSON列表.我这样称呼它:
var filter= "john";
var myApp = angular.module('myApp', []);
myApp.controller('SearchController', ['$scope','$http', function ($scope, $http) {
$http.get('/api/Entity/Find/' + filter). //Get entities filtered
success(function (data, status, headers, config) {
$scope.entities = data;
}).
error(function () {
});
}]);
Run Code Online (Sandbox Code Playgroud)
有用!
但是......如何更改filter
变量以更改查询?我应该重写整个控制器以使其工作吗?
很抱歉我的问题不够明确.当我问这个时,我无法承担任何AngularJS.
我最初的意图是$http
注入变量,而不依赖于为此创建控制器.
谢谢大家.
我刚刚使用Angular CLI创建了一个新的角度项目,并使用以下命令在其中搭建了一个新的路由用户.
ng new myproj
cd myproj
ng g route user
Run Code Online (Sandbox Code Playgroud)
然后我使用了Angular CLI服务器ng serve
.
但是当我访问页面时,我无法看到登录模板的内容,/login
除非我添加了某个路径的链接,即:
<a [routerLink]="['/user']">User Info</a>
Run Code Online (Sandbox Code Playgroud)
当我添加上面的行,然后router-outlet
填充,但如果我删除此行,则router-outlet
再次呈现为空.
这里发生了什么事?
有人知道为什么会这样吗?
import { Component } from '@angular/core';
import { Routes, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from '@angular/router';
@Component({
moduleId: module.id,
selector: 'myproj-app',
templateUrl: 'myproj.component.html',
styleUrls: ['myproj.component.css'],
directives: [ROUTER_DIRECTIVES],
providers: [ROUTER_PROVIDERS]
})
@Routes([
{path: '/user', component: UserComponent}
])
export class MyprojAppComponent {
title = 'Main Component working!';
} …
Run Code Online (Sandbox Code Playgroud) 我想获取当前NgModule的元数据,以便获取列表declarations
并providers
填充我创建的动态模块,以在模式中显示组件。
那怎么办呢?
angular ×2
angular-cli ×1
angular2-aot ×1
angularjs ×1
arrays ×1
c# ×1
delphi ×1
dll ×1
javascript ×1
metadata ×1