我正在尝试根据view bag中的值加载不同的局部视图,为此我尝试了以下javascript方法:
function CheckAction()
{
var cat = document.getElementById('CType').value;
var op = document.getElementById('OType').value;
if (op == "Add")
{
if (cat == "State")
我在问自己如何使用NGFaces在Angular中重新加载不同组件的内容。背景信息如下:在post请求成功后,我想重新加载视图,以显示从get请求中检索到的最新数据。插入页/组件位于另一个类中。
public create(name, description, archived, selectedParents): void {
http.post.subscribe(() => {
this.messageService.success('Worked');
//here the other component should call the get method
我希望避免显示初始JavaScript渲染视图时的延迟。我希望用户立即看到内容,并有角度从那里采取它。我不想在Angular ngRoute开始工作时替换这个ng-view,因为可能会发生闪烁。我只想在用户遇到另一个路由时替换它。
让我们假设这是基路由'/'。这可能已经存在于我的HTML中,从服务器呈现。
<div ng-view>
<h1>Welcome. I am the first view.</h1>
<p>Please do not replace me until a user has triggered anothe
我无法找到并解决如何通过编辑视图中加载的另一个ViewModel动态添加ViewModel条目。
假设我有一个包含anotherViewModel列表的ViewModel。
数据库模型:
public class ViewModel
{
public ViewModel()
{
anotherViewModel= new List<anotherViewModel>();
}
public string idViewModel{ get; set; }
public string description{ get; set; }
publi
我的示例应用程序有两个MVC控制器1、1.HomeController 2、2.DetailsController
HomeController.cs
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
Home -> Index.cshtml
<div>
Home - Index
</div>
DetailsController.cs