Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用angularJs生成一个功能正常的Web应用程序?_Javascript_Html_Angularjs_Eclipse_Web Applications - Fatal编程技术网

Javascript 如何使用angularJs生成一个功能正常的Web应用程序?

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

我试图通过构建一个网络应用程序来了解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-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'

        })