Thursday, October 16, 2014

Angular JS - Module configuration for routing

/*================ Routing ============*/

var module = angular.module('routeModule', ['ngRoute']);
    module.config(function ($routeProvider) {

        $routeProvider.when('/about', {
            templateUrl: '/WebSite1/About.html',
            controller: 'aboutController'


        }).when('/port', {
            templateUrl: '/WebSite1/portfolio.html',
            controller: 'portfolioController'


        }).otherwise({
            redirectTo: '/WebSite1/portfolio.html'
        });

    });

Angular JS - passing multiple parameters to another controller

$scope.copy = function (name) {
            $location.path('/port').search({ fname: $scope.txt_name, lname: $scope.txt_lname, email: $scope.txt_email });
        }