how do you use angularJs to produce a functioning webapp?

68 views Asked by At

I am trying to get my head around AngularJS by building a webapp.

I am using eclipse and so far I have 4 files. main.js, index.html, view1.js, view2.html.

Basically I can get index.html to load up when tomcat starts running and inside this file I have this code:

<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>

But when I click "Next Step" it does not go to the required page.

Code inside view1.js:

$scope.proceed = function() {
                    $scope.view1_btn01();
            };

code inside main.js:

$scope.view1_btn01 = function () {
    var view1extenstion = "http://localhost:8080/WebApp-01";
    window.location.href = view1extenstion + '#/extension';
};

what i expect to happen:

when i click next step it appends #/extension to the url and then bring up my view2.html. also in main.js:

.when('/extension', {
            templateUrl: 'view2.html'

        })
1

There are 1 answers

0
Avinash Solanki On

just start with Angular Seed, it will help you

https://github.com/angular/angular-seed

AngularJS: Up and Running is a very nice book to start