我正在尝试汇总 Angular 2 应用程序,但我有:
无法从 xxxx\wwwroot\angular\app\app.module.js 解析“app/components/xxx/xxxxx.component”
xxxxx.component
app.module 有这样的引用:
import { xxxxx } from 'app/components/xxx/xxxxx.component'
Run Code Online (Sandbox Code Playgroud)
所以 tsconfig.js 有:
"compilerOptions": {
...
"paths": {
"app/*": [ "./app/*" ],
...
},
"outDir": "wwwroot",
...
},
Run Code Online (Sandbox Code Playgroud)
如何解析汇总中的打字稿等路径别名?
我尝试过
1)https://github.com/frostney/rollup-plugin-alias
rollup-config.js:
export default {
entry: 'wwwroot/angular/app/main-aot.js',
dest: 'wwwroot/dist/build.js',
sourceMap: false,
format: 'iife',
plugins: [
nodeResolve({jsnext: true, module: true}),
commonjs({
include: 'node_modules/rxjs/**',
}),
alias({
'app': '.' // asuming "wwwroot/angular/app/" is the working dir
}),
uglify()
]
}
Run Code Online (Sandbox Code Playgroud)
2)https://github.com/dot-build/rollup-plugin-includepaths
rollup-config.js:
let includePathOptions = …
Run Code Online (Sandbox Code Playgroud) 我的数据库在VPS中,我应该从我的表中获得一些查询
因为从服务器获取查询需要很长时间(取决于Internet速度!),我想使用线程来获取查询
现在我创建一个线程并获取查询,然后通过发送和处理消息将结果发送到我的表单
我想知道是否可以在本地创建和使用线程?!?
我的意思是:
procedure Requery;
var
...
begin
Create Thread;
...
Pass my Query Component to Thread
...
Getting Query in Thread;
...
Terminate and Free Thread
...
Do next jobs with Query;
...
end;
Run Code Online (Sandbox Code Playgroud)
主要部分是最后一部分(做下一个工作......),我不想在消息处理程序中使用查询结果,我想在同一个程序和线程作业后使用它们
可能吗 ?!
我认为使用Delphi TThread类是不可能的,我应该使用其他线程技术......
我有以下......
var
LCnn: TADOConnection;
qryGetData: TADOQuery;
begin
...
//build a connection string to a SQL Server 2008
...
qryGetData.Connection := LCnn;
qryGetData.SQL.Text := 'SELECT * FROM MYTABLE'
...
LDate := qryGetData.FieldByName('Date').AsDateTime; //Date its a datetime field in the table
end;
Run Code Online (Sandbox Code Playgroud)
这工作正常但是,当某些Pcs中的"Date"字段为NULL时,LDate为0而另一个为-36522.
任何的想法???谢谢!
编辑:
奇怪的行为是
function TDateTimeField.GetAsDateTime: TDateTime;
begin
if not GetValue(Result) then Result := 0;
end;
Run Code Online (Sandbox Code Playgroud)
在第一种情况下,GetValue结果为false,因此GetAsDateTime结果为0,在第二种情况下GetValue结果为true,因此返回-36522(01/01/1800)
Procedure Exchangerates;
var
selection: integer;
answer, GBP, USD, EUR, JPY: string;
begin
Assignfile(ERfile, 'ER.dat');
reset(ERfile);
while not eof(erfile) do
begin
read(erfile, er);
writeln('Which currency do you want to convert from, euros, pounds, dollars or yen');
readln(answer);
if answer = 'GBP' then
begin
writeln('GBP');
writeln('How many pounds to you want to convert to dollars?');
readln(selection);
writeln(selection*er.usdtopound:0:2);
writeln('How many pounds do you want to convert to euros?');
readln(selection);
writeln(selection*er.eurotopound:0:2);
writeln('How many pounds do you want to convert to yen?');
readln(selection);
writeln(selection*er.yentopound:0:2) ; …
Run Code Online (Sandbox Code Playgroud)