首页 \ 问答 \ 使用angularjs中的ng-class评估多个变量(Evaluating multiple variables with ng-class in angularjs)

使用angularjs中的ng-class评估多个变量(Evaluating multiple variables with ng-class in angularjs)

我有一个像这样的对象:

{{blockParameters}}
{"courseid":"1","blockid":"2"} 

我想添加一个ng类的例子,如下所示:

ng-class="{blockParameters.courseid == 1 && blockParameters.blockid == 2 : 'active'}"

这给出了一个语法错误,我不知道正确的方式来做到这一点。


I have an object like this:

{{blockParameters}}
{"courseid":"1","blockid":"2"} 

I want to add an ng-class example like below:

ng-class="{blockParameters.courseid == 1 && blockParameters.blockid == 2 : 'active'}"

That gives a syntax error, i'm not sure on the correct way to do it.


原文:https://stackoverflow.com/questions/33742607
更新时间:2023-10-16 19:10

最满意答案

此错误实质上意味着无法将IP解析为主机名。

这里可能会发生一些事情:

  • 外部IP在内部不起作用,在这种情况下,您应该修改连接字符串,以便在必要时使用内部主机名和端口(它应该在GoDaddy中的某个位置可用)。

  • 您的IP和/或端口错误。 检查您的连接设置。

  • 您使用的连接字符串格式错误。 仔细检查提供者的格式。 我见过MySQL的连接字符串,其中端口是一个单独的参数,如下所示:

连接字符串Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;


This error essentially means the IP cannot be resolved to a host name.

A few things that might be going on here:

  • The external IP does not work internally in which case, you should modify your connection string so that it uses the internal host name and port if necessary (it should be available somewhere in GoDaddy).

  • You have the wrong IP and/or port. Check your connection settings.

  • You are using the wrong format for your connection string. Double check the format against the provider. I have seen connection strings for MySQL where the port is a separate argument, like this:

Connection String: Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

相关问答

更多
  • 版主,你测试装opencart OK?另外,我想问下,我另外买的GD-economy-windows已经装了一个asp企业网站,我现在想设置2级域名比如:shop.AAAAA.com主机空间内装一套PHP网店系统,或者在ASP企业网站的FTP里建个文件夹AAAA.com/shop放一php的网店系统,这样ASP和PHP会不会冲突?
  • 首先,您必须允许在GoDaddy的cpanel中托管两个站点。 如果您有权访问,则必须执行以下操作。 转到此链接 ,它是添加附加域的指南,并添加您的域( www.mylaravelapp.com )作为附加域。 它将在你的根目录中创建另一个文件夹,如mylaravelapp 。 然后将test目录的内容复制到mylaravelapp目录中。 现在结构是这样的: 文件夹 |`-- public_html |-- some_domain_folder |`-- mylaravelapp ...
  • 要获取成员资格提供程序使用的表,请查看%WINDIR\Microsoft.NET\Framework\v2.0.50727 。 这是向导所使用的SQL语句的位置。 另外,请查看: http : //www.asp.net/Learn/Security/tutorial-04-vb.aspx ,以更全面地了解如何设置成员表。 您可以完成管理工具所做的所有工作,而不是GUI格式。 To get the tables that the membership provider uses, look in %WIND ...
  • 当您注册域名时,您需要为您的域名选择权威名称服务器。 如果您在这些名称服务器上定义了两个A(主机)记录,例如godaddy.mydomain.com和www.mydomain.com,那么您可以引用您的Godaddy服务器上的MySQL和您的Squarespace服务器来托管您的网站。 When you sign up for a domain, you need to select authoritative name servers for your domain. If you define two ...
  • 发现我的问题。 这是我的public_html文件夹中的Laravel 5 .htaccess。 我只是将其重命名为其他东西,然后我的第二个网站工作,然后将其重新命名为原始版本,然后所有网站都正常工作。 Found out my problem. It is my Laravel 5 .htaccess on my public_html folder. I just rename it to something else and my second website works then rename it ...
  • 我发现这个问题与我的配置有关,实际上我已经设法使其工作,它是这样的: ASPX部署: 可执行文件的路径: C:\ WINDOWS \ SYSTEM32 \ WindowsPowerShell \ V1.0 \ powershell.exe 参数: -c“(new-object system.net.webclient).downloadstring(' http://YOUR_DOMAIN.in/Default.aspx ')” 注意 :Default.aspx必须放置在httpdocs文件夹中(这是您放置 ...
  • 此错误实质上意味着无法将IP解析为主机名。 这里可能会发生一些事情: 外部IP在内部不起作用,在这种情况下,您应该修改连接字符串,以便在必要时使用内部主机名和端口(它应该在GoDaddy中的某个位置可用)。 您的IP和/或端口错误。 检查您的连接设置。 您使用的连接字符串格式错误。 仔细检查提供者的格式。 我见过MySQL的连接字符串,其中端口是一个单独的参数,如下所示: 连接字符串 : Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myU ...
  • 请检查您的密码或尝试重置密码。 另请检查主机名可能不是localhost。 检查这个去phpMyAdmin并在右侧面板中查看。 参考下面的图片.. please check your password or try resetting the password. Also check host name might not be localhost. to check this go to phpMyAdmin and see in the right panel. Refer below image..
  • 以下代码段对我有用。 尝试此代码,如果它不适合您,您可以记录整个异常消息。 MailMessage Msg = new MailMessage(); // Sender e-mail address. Msg.From = new MailAddress(txtEmail.Text); // Recipient e-mail address. Msg.To.Add("admin@abc.com"); //Msg.Subject = txtSubject.Text; Msg.Body ="some body ...
  • 就像评论中提到的Krishanu Dey一样,你不能在GoDaddy的共享主机上使用LinqToExcel,因为他们不会让你安装LinqToExcel使用的所需OleDb引擎。 您将需要考虑获得VPS来安装OleDeb引擎。 I solved it using openxml SDK , a little bit slower but it do the task

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)