Javascript 如何使用angularJs生成一个功能正常的Web应用程序?
我试图通过构建一个网络应用程序来了解AngularJS 我正在使用eclipse,到目前为止,我有4个文件。main.js、index.html、view1.js、view2.html 基本上,我可以在tomcat开始运行时加载index.html,在这个文件中,我有以下代码:Javascript 如何使用angularJs生成一个功能正常的Web应用程序?,javascript,html,angularjs,eclipse,web-applications,Javascript,Html,Angularjs,Eclipse,Web Applications,我试图通过构建一个网络应用程序来了解AngularJS 我正在使用eclipse,到目前为止,我有4个文件。main.js、index.html、view1.js、view2.html 基本上,我可以在tomcat开始运行时加载index.html,在这个文件中,我有以下代码: <form method="post" id="view1-form1" ng-submit=proceed();> <......> <div class="next-ste
<form method="post" id="view1-form1" ng-submit=proceed();>
<......>
<div class="next-step">
<button type="submit" class="form-btn" id="btn01" ng-click="submitted=true">
Next step
</button>
</div>
main.js中的代码:
$scope.view1_btn01 = function () {
var view1extenstion = "http://localhost:8080/WebApp-01";
window.location.href = view1extenstion + '#/extension';
};
我期望发生的事情:
当我单击“下一步”时,它会将#/扩展名附加到url,然后打开我的view2.html。
同样在main.js中:
.when('/extension', {
templateUrl: 'view2.html'
})
只要从有角的种子开始,它会帮助你
AngularJS:Up and Running是一本非常好的入门书你完成AngularJS教程了吗?您应该首先尝试AngularJS教程,并阅读有关路由的章节。您忘记了
procedure()
:ng submit=“procedure()”
.when('/extension', {
templateUrl: 'view2.html'
})