0

My routing is working fine but for some reason when I tried to add a carousel instead of just the images the entire page slides in from the side.

I am not sure if my structuring is correct or if I am missing something?

app.js

    var app = angular.module('Main', ['ngRoute', 'ngAnimate', 'ui.bootstrap', 'Main.Controller'])

app.config(function ($routeProvider) {

    $routeProvider.when('/app', {
        templateUrl: 'index.html',
        controller: 'appCtrl'
    }).when('/Home', {
        templateUrl: 'templates/Home.html',
        controller: 'HomeCtrl'
    }).when('/Portfolio', {
        templateUrl: 'templates/Portfolio.html',
        controller: 'PortfolioCtrl'
    }).when('/Contact', {
        templateUrl: 'templates/Contact.html',
        controller: 'ContactCtrl'
    }).otherwise({
        redirectTo: "/Home"
    });

})

HomePage

<header>

    <div class="container">
        <div class="row">
            <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                <!-- Indicators -->
                <ol class="carousel-indicators">
                    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
                </ol>

                <!-- Wrapper for slides -->
                <div class="carousel-inner" role="listbox">
                    <div class="item active">
                        <img src="images/Headers.jpg" />" alt="...">
                        <div class="carousel-caption">
                            ...
                        </div>
                    </div>
                    <div class="item">
                        <img src="images/Headers.jpg" alt="...">
                        <div class="carousel-caption">
                            ...
                        </div>
                    </div>
                    ...
                </div>

                <!-- Controls -->
                <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
        </div>
    </div>
</header>
<!-- class="page {{ pageClass }}"-->
  <!-- Section One -->
<section class="One">
    <div class="container">
        <div class="row text-left">
            <div class="col-lg-4">
                <h2 class="Section-title">About</h2>
                <hr />
            </div>
        </div>
        <div class="row">

            <div class="col-lg-8 text-left border">
                <p></p>
            </div>
        </div>
    </div>
</section>

1 Answer 1

0

I guess you need to check for href of carousel which may interfere with your routing

href="#carousel-example-generic"

refer Bootstrap carousel not working with angularjs

Angular routing with bootstrap carousel issue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.