问题标签 [angularjs-routing]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
angularjs - 匹配路线并渲染局部
是否可以根据路线名称渲染部分内容?
例如,而不是这样做:
做这样的事情:
我在哪里使用{{}}
来显示我想要发生的事情。
如果不清楚,请告诉我,我会尽力澄清。
asp.net-mvc - AngularJS路由失败
请有人告诉我为什么视图没有被插入到 ng-view 占位符中?我正在使用带有 HomeController 的标准 Visual Studio MVC 项目模板,并且我的所有 .cshtml 文件都在 /Views/Home 中
我正在浏览http://localhost:12345/Home/Example04#/view1
我看到了 Example04 标头,但没有看到 _View01.cshtml 的内容
这是呈现的html:
angularjs - AngularJS: Refrain from changing the browser location URL to stop user from bookmarking an error page?
I have a form that I need to submit, if something goes wrong I would like to show an error page, I have a controller and view for this but I would like for the browser location textbox not to change to avoid the user from bookmarking the error page.
So I would have a page called /Items
the user submits and there was an error so I would like to show this page (itemsError.html) to the user but I don't want to allow the user to bookmark /ItemsError
If I plugin into the routeprovider then the browser location bar is going to update with something like /ItemsError and at a later date the user could bookmark the page, but this page is a dynamic page and should only be shown depending on the result of the form submission.
What is Angular's best practice for supporting something like this?
Thanks
angularjs - 将路线链接到指令?还是另一种方式?
我有一个不寻常的问题。
我有这个要转换为 angular.js 的旧页面。
我在一页上加载了 5 页的 html,唯一可见的部分是已导航到的部分。即家在x位置0,大约在x位置,1024,项目在x位置2048,等等......
现在虽然没有办法链接到各个部分。您必须在家中着陆,然后导航到您要访问的部分。
但是我想添加一个深层链接的 url:url/#/home、url/#/project 等,以与触发页面位置更改的导航相对应。
有没有办法将 angularjs 中的路由器链接到指令,以便触发新的 dom 行为而不是加载 html 模板?
谢谢你的帮助!
angularjs - 配置 AngularJS 路由
我从 AngularJS 开始,我遇到了一些路由问题。我为html5mode配置了我的项目,我设置了我的标签,一切都很好。
当我尝试使用引导模式时,问题就来了。触发模式的链接是:
模态代码是:
因此,锚点中的 href 引用了模式的 id,而不是路由。但是我的应用程序将进入主页(因为我想是“否则”)。
我可以说 AngularJS 忽略这一点吗?还是有更好的解决方案?
非常感谢!
javascript - AngularJS 路由重命名
我有一个可以继续使用的 Angular 应用程序,mysite.com/angularapp
并且不需要路由提供程序。当我加载页面时,URL 更改为mysite.com/angularapp#/angularapp
. 我希望 URL 不包含哈希。我可以手动清除它,window.location.hash
但我希望它被禁用,这样 URL 就不会从一开始就随着散列 URL 闪烁。我也不能使用html5mode
(source),因为仍然有许多链接绑定到服务器端请求(所以我不能简单地重新路由我的整个应用程序以作为单页应用程序工作)。我该怎么做呢?
angularjs - 在指令中带有 URL 的 AngularJS 部分 - 最佳实践?
我非常喜欢 angular-ui 创建 ui-routes 的方式,它提供了命名路由(除其他外)。
虽然可能是一个简单的指令——ui-view 的包装器——但我不确定这是否是最佳实践。
使用以下逻辑:
您认为,这种设置是否属于最佳实践范围?
顺便说一句:已经有这样的事情了吗?
angularjs - AngularJS:处理子文件夹中的根和子应用程序
我有两个 AngularJS 应用程序:
- 是基础应用程序并在根目录下运行
/
- 是一个子应用程序,出于设计原因需要隔离并在子文件夹中运行,例如
/foo/
如何将请求从根应用程序路由到子应用程序?
我遇到的最大问题是 URL 路由选择了此子应用程序路由,并且由于此路由未在根应用程序中定义,因此它由otherwise
我无法将用户发送到子应用程序来处理。
angularjs - 当 $location.search 更新 GET 参数时,避免 ng-view 被“擦除”(更新)
所以我有一个使用传单库实例化的地图对象。地图实例在单独的模板中创建并以这种方式路由:-
当我想处理“搜索/过滤”并在搜索我想要加载到地图实例上的对象时控制 GET 参数时,问题就开始了。
这是我实现的一个简单的过滤器功能,它根据用户单击的选定值(在下拉列表中)触发。
浏览器地址栏的 url 会按照我的预期进行更新,但原始(传单)地图对象会“更新”并从视图中消失。这不是我想要的。
如何防止这种情况发生或控制此过程以便仍然可以看到地图?
asp.net - AngularJs + ServiceStack 应用程序的安全性
我有一个在前端有四个模块的应用程序,我试图在前端使用尽可能多的 AngularJs 我正在使用一个空的网站 asp.net 项目来托管所有文件和 REST serviceStack,我的项目具有以下结构:
我使用 angularjs 服务调用,而后端我使用的是带有 servicestack 的 REST。
问题是我怎样才能限制只有经过身份验证的用户才能访问那些静态 html 文件?假设在公司、后端和用户内部的那些,例如