JavaScript Update {{alert.currentPage}} in directive on each route change in angular-route

Mainly I am trying to figure out how to update alert.currentPage for each route. I switched everything to a directive but still am at a loss. Any direction would be helpful.

Thanks!

REWRITTEN ALL CODE BASE index.html:

<!doctype html>
<html lang="en" ng-app="mydh" ng-controller="mainController">
<head>
<title>{{ pageTitle }}</title>
  <link rel="stylesheet" target='_blank' href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <link rel="stylesheet" target='_blank' href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
  <link rel="stylesheet" target='_blank' href="assets/stylesheets/app-dashboard.css">
  <script src="assets/javascript/jquery-2.1.4.min.js"></script>
  <script src="assets/javascript/bootstrap.min.js"></script>
  <script src="assets/javascript/angular.min.js"></script>
  <script src="assets/javascript/angular-route.js"></script>
  <script src="assets/javascript/app/app.js"></script>
  <script src="assets/javascript/app/app-template.js"></script>
  <base target='_blank' href="/">
</head>
<body>
  <page-navigation></page-navigation>
  <page-alerts></page-alerts>
  <div ng-view></div>
  <page-footer></page-footer>
</body>
</html>

app.js:

(function() {
    var app = angular.module('mydh', ['ngRoute', 'mydhTemplate']);

    app.directive('pageAlerts', function() {
        return {
            restrict: 'E',
            templateUrl: 'tmpl/alerts.html',
            controller: function() {
                this.currentPage = 'Dashboard';
            },
            controllerAs: 'alert'

        };
    });

    app.config(function($routeProvider, $locationProvider) {
        $routeProvider
        .when('/', {
            templateUrl : 'pages/mydash.html',
            controller  : 'dashController',
        })

        .when('/wizard', {
            templateUrl : 'pages/wizard.html',
            controller  : 'wizardController',
        })

        .when('/reporting', {
            templateUrl : 'pages/reporting.html',
            controller  : 'reportingController',
        })

        .when('/billing', {
            templateUrl : 'pages/billing.html',
            controller  : 'billingController',
        })

        .when('/catalog', {
            templateUrl : 'pages/catalog.html',
            controller  : 'catalogController',
        });

        $locationProvider.html5Mode(true);
    });

    app.controller('mainController', function($scope,$http) {
        $scope.pageTitle   = 'Demo Page';

    });

})();

tmpl/alerts.html:

<div class="container">
    <div class="row">
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i> Home</li>
                <li class="active">{{ alert.currentPage }}</li>
                <li class="pull-right"><i class="fa fa-cog"></i></li>
            </ol>
            <div class="alert alert-danger alert-dismissable" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <strong><i class="fa fa-exclamation-triangle"></i> Alert:</strong> Placeholder for alert information, if we ever need to display something crital! <a target='_blank' href="#" class="alert-link">Read more...</a>
            </div>
            <div class="alert alert-info alert-dismissable" role="alert">
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <strong><i class="fa fa-info-circle"></i> Info:</strong> Placeholder for any information alerts we may want to display. <a target='_blank' href="#" class="alert-link">Read more...</a>
            </div> 
        </div>
    </div>
</div>
Answer:1

How can you add a class to a tag with a custom attribute? Most people use ID, but in my case I need to use a custom attribute. CSS: .correct { background-color: lightGREEN; } JQuery: $(".save")...

How can you add a class to a tag with a custom attribute? Most people use ID, but in my case I need to use a custom attribute. CSS: .correct { background-color: lightGREEN; } JQuery: $(".save")...

  1. classu003d custom-file-input
  2. classu003d custom-select
  3. classu003d custom-control-input
  4. class custom details and tires
  5. classu003d custom-file
  6. classu003d custom-file-input bootstrap
  7. class custom carriers
  8. classu003d custom-file-label
  9. class custom
  10. class custom css
  11. class custom attribute c#
  12. class custom pickle
  13. class custom decorator python
  14. class custom ring
  15. class custom cout
  16. d&d custom class
  17. kotlin data class with custom setter

I'm trying to have same size images with flexbox. I give a display: flex; to my slick-track container and then flex: 1 0 auto to my img. I thought that with a flex-grow of 1 my image will increase if ...

I'm trying to have same size images with flexbox. I give a display: flex; to my slick-track container and then flex: 1 0 auto to my img. I thought that with a flex-grow of 1 my image will increase if ...

  1. same height images css
  2. same height images bootstrap
  3. same height images
  4. equal height images css
  5. equal height images bootstrap 4
  6. equal height images flexbox
  7. equal height images
  8. same height couples images
  9. flex same height images
  10. same height and width images
  11. slick slider same height images
  12. owl carousel same height images
  13. images same height html

On this page here. It's possible to see that the Facebook login button is initially disabled. (Using [disabled]="myProperty") Once an API request /facebooklogin/isnewuser returns, it is enabled. ...

On this page here. It's possible to see that the Facebook login button is initially disabled. (Using [disabled]="myProperty") Once an API request /facebooklogin/isnewuser returns, it is enabled. ...

I am trying to create a game for fun in Captivate. The game will mimic a wheel of fortune or spin the wheel format. I am trying to put a different spin on it, and not have any repeating numbers. ...

I am trying to create a game for fun in Captivate. The game will mimic a wheel of fortune or spin the wheel format. I am trying to put a different spin on it, and not have any repeating numbers. ...

  1. javascript captivate 2017
  2. captivate javascript commands
  3. captivate javascript examples
  4. captivate javascript change state
  5. captivate javascript api
  6. captivate javascript jump to slide
  7. captivate javascript variables
  8. captivate javascript functions
  9. captivate javascript go to next slide
  10. captivate javascript show hide
  11. captivate javascript interface
  12. captivate javascript alert
  13. captivate javascript advanced actions
  14. captivate javascript library
  15. captivate javascript go to slide
  16. captivate javascript play video
  17. captivate javascript next slide
  18. captivate javascript reset quiz
  19. captivate javascript pause
  20. captivate javascript close window