Join the Stack Overflow Community
Stack Overflow is a community of 6.3 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I have a block of HTML in an Angular partial that's not making it into the view for some reason. Every other line of HTML in the partial (including other lines with data-binding and references to my service and its methods) are making it in. Had a hard time locating previously asked questions that answer this specific issue...

Here's the missing block:

<div ng-controller="PlayerBar.controller" class="player-bar">
  <div class="container">
  <div class="currently-playing player-bar-control-group">
    <h2 class="song-name"> {{ songPlayer.currentSong.name }} </h2>
    <div class="seek-control">
      <slider value="{{playTime}}" max="{{songPlayer.currentSong.length}}" on-change="songPlayer.seek(value)"><slider>
      <div class="current-time">{{ playTime | timecode }}</div>
      <div class="total-time">{{ songPlayer.currentSong.length | timecode }}           </div>
    </div>
    <h3 class="artist-name">{{ songPlayer.currentAlbum.artist }}</h3>
  </div>
</div>

My controller in which my scope variable is defined:

Jams.controller('PlayerBar.controller', ['$scope', 'SongPlayer', function($scope, SongPlayer){
  $scope.songPlayer = SongPlayer;

  SongPlayer.onTimeUpdate(function(event, time) {
    $scope.$apply(function() {
      $scope.playTime = time;
    });
  });
}]);

My service where my method is defined:

Jams.service('SongPlayer', ['$rootScope', function($rootScope) {
  var currentSoundFile = null;
  return {
    onTimeUpdate: function(callback) {
      return $rootScope.$on('sound:timeupdate', callback);
    },
  };
}]);

And my timecode filter:

Jams.filter('timecode', function() {
  return function(seconds) {
    seconds = Number.parseFloat(seconds) 

    if (Number.isNaN(seconds)) {
      return '-:--';
    }

    var wholeSeconds = Math.floor(seconds)
    var minutes = Math.floor(wholeSeconds / 60);
    remainingSeconds = wholeSeconds % 60;
    var output = minutes + ':';

    if (remainingSeconds < 10) {
      output += '0';
    }

    output += remainingSeconds;

    return output;
  }
});

Curious as to why only these lines are left out while others make it in.

share|improve this question
    
did this make it? <div class="current-time"> ? just the values in the div missing ? or the entire div is missing? if the entire div is missing you have to post what parents / surrounding divs are – Scott Selby May 13 '15 at 1:37
    
Thanks Scott. The entire div is missing. I'll update it with the surrounding parents. – tyler reitz May 13 '15 at 1:39
    
try turning off javascript and see if those divs get rendered. I have never heard of anything like that , unless there is some script setting the html of the parents . and that doesn't look like the case – Scott Selby May 13 '15 at 2:26
    
Not enough known to really know why ... without a lot of guessing. How is partial referenced to be included? – charlietfl May 13 '15 at 2:44
up vote 1 down vote accepted

You haven't closed your slider element properly

share|improve this answer
1  
Thank you kachhalimbu. A little embarrassed I didn't catch that. I'm only just starting out with Angular (front end, really) and couldn't see the forest for the trees, so to speak. – tyler reitz May 13 '15 at 4:15
1  
For the future, you could try the tool this guy made or this library I like to use in Sublime. There’s always the HTML validator as well. – Matt Born May 13 '15 at 12:55
    
Good point @Matt I just pasted his snippet in WebStrom and that's the first thing I noticed because the built-in HTML validators flagged it as a error – kachhalimbu May 13 '15 at 13:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.