Changes in html template do not reflect

1.6k Views Asked by At

I am trying to add some buttons to the GeoNetwork 3 MapViewer. Unfortunately I'm new to AngularJS, which GN3 is written in. So what I've done is editing the html-template that the 'gnMainViewer' directive is using.

ViewerDirectve.js:

module.directive('gnMainViewer', [
'gnMap',
function(gnMap) {
  return {
    restrict: 'A',
    replace: true,
    scope: true,
    templateUrl: '../../catalog/components/viewer/' +
        'partials/mainviewer.html',
[...]
}]);

In this template I can find the buttons that are shown in the MapView.

mainviewer.html:

  <div class="wrapper" data-ng-controller="gnViewerController">

  <div data-gn-alert-manager=""></div>
  <div id="map" ngeo-map="map" class="map"></div>
  <div gn-gfi="" map="map"></div>
  <div gn-localisation-input map="map"></div>

  <!--Top right buttons - Tools-->
  <div class="tools tools-right" gi-btn-group gnv-close-panel data-ng-controller="toolsController">
    <button class="btn btn-default" ng-model="activeTools.addLayers" type="submit"
            rel="#addLayers" gi-btn gnv-tools-btn>
      <span class="fa fa-plus"></span>
      <span role="tooltip" data-translate="">addLayers</span>
    </button>
    <button class="btn btn-default" ng-model="activeTools.layers" type="submit"
            rel="#layers" gi-btn gnv-tools-btn>
      <span class="fa fa-tasks"></span>
      <span role="tooltip" data-translate="">Layers</span>
    </button>

[...]
</div>
</div>

So I've added a button let's say:

<button class="btn btn-default" ng-model="" type="submit"
            rel="#" gi-btn gnv-tools-btn>
      <span class="fa fa-beer"></span>
      <span role="tooltip">NewButton</span>
    </button>

to the template.

Then I've saved my changed and refreshed the MapView-Page on my server. But a new button will not be displayed. Also, changing the comment "Top right buttons" to something else will not make any changes to the displayed MapView-Page. Even restarting the server won't change anything.

Could somebody explain me why AngularJS reacts like this? Any Ideas?

1

There are 1 best solutions below

0
On

Turned out I had to run the page in debug mode e.g. http://localhost:8080/geonetwork/srv/ger/catalog.search?debug#/map to force to load all AngularJS files seperately and without cache.