<button id="tagBtnId" name="TagsFilter" ng-show="disableTagButton">Tags</button>
Run Code Online (Sandbox Code Playgroud)
NG-显示应用display: none或display: block财产,但我想申请visibility: hidden和visibility: visible财产.
CREATE PROC spIsValidUser
@UserName varchar(50),
@Password varchar(50)
AS
IF Exists(SELECT * FROM Users where UserName=@UserName and Password=@Password)
BEGIN
return 0
END
ELSE
BEGIN
return 1
END
GO
Run Code Online (Sandbox Code Playgroud)
我创建了这个Stored Procedure并且Stored Procedure使用实体框架来调用它.下面是用C#编写的代码.
MyBusEntities db = new MyBusEntities();
int empQuery = db.spIsValidUser("abc", "abc@123");
Run Code Online (Sandbox Code Playgroud)
spIsValidUser Stored Procedure-1在所有情况下都返回.请告诉我错误.
编辑 - 根据给定的答案,存储过程不使用return语句,因为实体框架不能支持存储过程返回开箱即用的标量值.让我知道如何从标量数据发送Stored Procedure?
我的项目中有以下代码返回.employeeService.getJson()函数返回promise对象.承诺的成功方法不在承保范围内.
//controller code which access service method.
export class EmployeeCtrlClass {
constructor(){
employeeService.getJson() //get promise
.success(function (xyz) {
employeeService.testdata = xyz.Employee;
_this.employeeData = employeeService.testdata;
});
}
}
// function in Service code
public getJson() {
return this.$http.get('../json/TestDataJson.json'); //return promise
}
Run Code Online (Sandbox Code Playgroud)
下面的代码是针对测试用例编写的.
it('controller constructor',() => {
//simply i am calling constructor of controller class.
var ctrlObj = new EmployeeCtrlClass($scope, empService);
});
Run Code Online (Sandbox Code Playgroud)
如何在代码覆盖中涵盖此代码?谢谢.
编辑: -我已将我的测试用例更改为下面,它正在工作.
it('controller constructor',() => {
httpB.expectGET('../json/TestDataJson.json').respond(employeeModule.testDataJson);
var ctrlObj = new EmployeeCtrlClass($scope, empService);
httpB.flush();
});
Run Code Online (Sandbox Code Playgroud) let rec recFunc=
let read = stream.Read(buffer, 0, buffer.Length)
match read with
| a when a <= 0 -> ms.ToArray()
| _ -> recFunc // Called recursion Function
buffer
Run Code Online (Sandbox Code Playgroud)
我是F#的新手,并且尝试使用递归函数,但是代码显示error
The value recFunc will be evaluated as part of its own definition。
我指的是MSDN页面,在此页面中,斐波那契函数在函数体内也被再次调用。让我知道可能的解决方案。
我正在使用karma工具进行测试.我无法覆盖foreach语句中的代码.请告诉我如何使用jasmine测试用例来覆盖此代码.
为此,我在茉莉花的下面写了套件.
describe('Employee test', function () {
beforeEach(() => {
module('app');
inject((_$controller_: ng.IControllerService, _$httpBackend_: ng.IHttpBackendService, $http: ng.IHttpService) => {
httpB = _$httpBackend_;
http = $http;
empService = new EmployeeService($http);
ctrl = $controller("employeeCtrl", { $scope: $scope, empService });
});
it("controller constructor",() => {
empService.testdata = [];
var ctrlObj = new employeeCtrlClass($scope, empService);
});
});
Run Code Online (Sandbox Code Playgroud)
在这里,我正在创建employeeCtrlClass对象,以便间接称为函数的构造函数.但它无法调用foreach声明.
我在gruntFile.js中写了下面的代码.
typescript: {
base: {
options: {
target: 'es5',
sourceMap: true,
noImplicitAny: true
}
},
default: {
files: [
{ src: 'source/tests/**/*.ts', dest: 'build'},
{ src: 'source/scripts/**/*.ts', dest: 'build'}
]
}
},
Run Code Online (Sandbox Code Playgroud)
我试图从命令行运行" grunt typescript "命令.它显示以下错误.
我也试过" grunt typescript --force "命令.但它仍然无法正常工作.

仍然不是创建构建文件夹,这意味着任务无法正常工作.提前致谢.
编辑: - 我已将我的gruntfile.js更改为以下作为答案中的建议.
typescript: {
base: {
src: ['source/tests/**/*.ts'],
dest: 'build/',
options: {
target: 'es5',
sourceMap: true,
noImplicitAny: true
}
},
}
Run Code Online (Sandbox Code Playgroud)
但我仍面临同样的问题.
我有一个类服务和一个接口IService.我想将这两个实现到ExampleService类.
我知道C#,在C#中我们可以使用下面的代码来做到这一点
class ExampleService : Service, IService
{
}
Run Code Online (Sandbox Code Playgroud)
我怎么能用F#.谢谢.
我想在JavaScript中将图标设置为诅咒指针.我尝试了一些默认光标样式.见下面的代码.
<span style="cursor:pointer">auto</span><br>
Run Code Online (Sandbox Code Playgroud)
但我想将我的图标设置为光标.示例: - "cursor:My Icon".
我如何在CSS中设置它?
我在C#中有以下代码.它工作得很好.
WindowsIdentity winId = (WindowsIdentity)HttpContext.Current.User.Identity;
WindowsImpersonationContext ctx = winId.Impersonate();
ctx.Undo();
Run Code Online (Sandbox Code Playgroud)
但我想在F#中转换这段代码.我写了下面的代码.
Let winId = HttpContext.Current.User.Identity :> WindowsIdentity //Showing error
Let ctx = winId.Impersonate()
ctx.Undo()
Run Code Online (Sandbox Code Playgroud)
在上面的代码HttpContext.Current.User.Identity是不能投入的WindowsIdentity.请让我知道我该怎么做.
angularjs ×3
f# ×3
css ×2
jasmine ×2
c# ×1
css3 ×1
function ×1
gruntjs ×1
html ×1
inheritance ×1
javascript ×1
recursion ×1
sql ×1
sql-server ×1
typescript ×1
unit-testing ×1