div中的UI-Router默认视图 [英] UI-Router default view inside div

查看:163
本文介绍了div中的UI-Router默认视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有index.html:

Say I have index.html with:

<div ui-view="viewA">
    // content
</div>

将内容放在div中是否可以作为默认路由?所以没有包含或其他任何东西,只需要在该div中直接放置一些标记。

Is it posible to put content inside div that will serve to me as default route? So without including or anything else, just need to put some markup directly in that div.

推荐答案

有一个工作人员

这是可能的,真的满容易。所以,让我们在index.html中有这个

That is possible, and really pretty easy. So, let's have this inside of index.html

<div ui-view="">

  this is the content of ui-view, 
  which serves as a template for a default state

</div>

这可能是默认状态,否则

And this could be the default state and otherwise

$urlRouterProvider.otherwise('/default');

// States
$stateProvider
  .state('default', {
      url: "/default",
  })

检查这里

这篇关于div中的UI-Router默认视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆