java 酒店管理系统论文哪里有?
哪里有java 酒店管理系统论文?
更新时间:2023-08-09 20:08
最满意答案
尝试:
self.scope.$apply(function(){ //Use $apply to let angular aware of the changes. var index = $(ev.currentTarget).parent().index(); self.scope.$parent.template = self.scope.menuItems.left[index]; //accessing self.scope.$parent instead of self.scope });
解释为什么我们必须访问self.scope。$ parent:
self.scope
是ng-repeat
生成的当前项的范围,而ng-include
绑定到menuCtrl的范围。self.scope.$parent
是这种情况下menuCtrl的范围。Try:
self.scope.$apply(function(){ //Use $apply to let angular aware of the changes. var index = $(ev.currentTarget).parent().index(); self.scope.$parent.template = self.scope.menuItems.left[index]; //accessing self.scope.$parent instead of self.scope });
Explanation why we have to access self.scope.$parent:
self.scope
is the scope of the current item generated byng-repeat
while yourng-include
is binding to menuCtrl's scope.self.scope.$parent
is menuCtrl's scope in this case.
相关问答
更多-
尝试: self.scope.$apply(function(){ //Use $apply to let angular aware of the changes. var index = $(ev.currentTarget).parent().index(); self.scope.$parent.template = self.scope.menuItems.left[index]; //accessing self.scope.$parent instead of se ...
-
您错过了字符串中卡片上的转发转义,并且ng-include需要单引号,因为它会将您的网址解析为表达式。 template:'' You are missing a closing escaped ' on card in your string and ng-include requires single quotes as well, since it will parse your ...
-
我遇到了处理带有角度的文件输入的类似问题。 你可以创建一个指令来监听文件更改并用文件调用它的控制器函数。 这里jsFiddle为它。 var app = angular.module('app', []); app.controller('yourCtrl', function() { $scope.image; $scope.imageChanged= function (files) { $scope.image = files; }; }); app.dir ...
-
通过控制器和指令Angualar-js动态更新ng-include(Dynamic update of ng-include through controller and directive Angualar-js)[2023-09-21]
因为您在单击时使用普通元素启动此事件,所以它不会调用摘要周期。 在$ scope.tab = newTab之后添加$ scope。$ apply(); Because you are initiating this thing with a normal element on click, It doesn't invoke the digest cycle. Add $scope.$apply() after $scope.tab=newTab; -
您是通过Web服务器访问应用程序还是通过file:// protocol访问该文件? 在后一种情况下,由于浏览器的安全限制,它将无法工作。 解决方案是安装Apache或Nginx并通过http://localhost/myapp/index.html类的东西访问应用程序。 Are you accessing the app through a web server or by accessing the file through file:// protocol? In the latter case it ...
-
Angular JS ng-include javascript无法运行部分onload(Angular JS ng-include javascript not working partial onload)[2021-05-12]
在ng-include提供HTML解析之前,您的代码似乎已经过处理。 只有在已加载HTML时才需要触发该功能。 另外,更改代码的一些声明: // to 添加onload属性,调用您的控制器上的函数: ... -
问题在于指令。 指令第一次上升时,该值已经存在,因此它会呈现您想要做的任何事情。 在后续单击时,ng-if和ng-include不会更改,因此指令不会再次初始化,并且不会更新该值。 ng-include和ng-if是多余的。 更改值应在$ scope。$ watch函数内处理,然后angular将对更改做出反应。 顺便说一句 - 你不需要$scope.$digest() ,因为当你点击ng-click时你已经有了$ digest周期。根目录与index.html文件( 路径: ui/app )相同。 如果文件view1.html位于路径ui/app ,则ng-include将如下所示: 因为ui/app是根路径 。 The root directory is the same that index.htmlfile (path: ui/app). If the file view1.html is in the path ui/app, the ng-in ...首先,加载后的所有角度html都会转到$ templateCahce,您可以手动管理,例如: $templateCache.put('qwerty', 'pit is best'); 然后 您还可以使用$templateCache.remove从中删除任何内容。 如果删除模板,则angular将尝试从服务器加载新的html。 现在浏览器缓存可能会起作用 - 要禁用它,您可能需要在http拦截器中添加类似?timestamp =的 ...您不需要在单引号内使用test.html。 试试这个: 此外,ng-include无法使用file:///协议,因此请确保您使用的是Web服务器。 You don't need test.html inside single quotes. Try this: Also, ng-include will not working using the file:// ...
相关文章
更多- java权限管理系统-组织机构管理
- Java 简介
- java是什么
- Java 异常处理
- java 消息管理
- Java 方法
- JAVA WEB
- Java项目实战从入门到精通_成绩管理系统动力节点
- java OA视频教程-报名与审核管理系统
- 孔浩java cms完整视频教程(java内容管理系统视频教程)
最新问答
更多- 您如何使用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)