Hi Sean
Thanks for the reply. I am new to angular and very new to writing directive and still getting my head wrapped around the different parts and options etc. I have updated my code to the simpler approach you mentioned and retested with the same overall results. My code now looks like the following:
var app = angular.module('timelineTest', []);
app.directive('qcTimeline', [function(){
return function(scope, elm, attrs) {
scope.$watch('attrs.qcTimeline', function(){
if(scope[attrs.ngTimeline]){
var timelineConfig = {
type: 'timeline',
width: '100%',
height: '500',
embed_id: 'timeline',
css: 'css/themes/metro.css',
source: scope[attrs.qcTimeline]
};
createStoryJS(timelineConfig);
};
});
}
}]);
function Controller($scope) {
//test data to verify angular is working
$scope.someData = 'initial value';
//this is where I am showing code that I know will not work but it will at least show you what I am doing
//data is retrieved from an injected service
service.getData(id).then(function(d) {
$scope.rawData = d;
$scope.timelineData = parseRawData($scope.rawData);
<div ng-controller="Controller">
<span ng-hide="editMode" ng-click="editMode=true">{{someData}}</span>
<div id='timeline' ng-timeline='timelineData'></div>
</div>
so again when I click the link from the home page to the page displaying this data, I get a blank panel where the timeline should appear. If I hit refresh it loads fine.
Ok so I just found something interesting that I will have to leave for tomorrow to look into more (if anyone has any ideas I am open to hearing them).
Ok so my overall app hierarchy looks like this
Main page with a menu for the user to select type of data to view (car data, house data, or boat data). Each option has its own page with links to specific records showing data of that type (show all cars, all houses, or all boats). The timeline is available for viewing data within a specific record (show details on a specific car, timeline would show when purchased, and when maintenance was done etc). The top of each details page has a menu that can be used to go from a details page to any other page (home, all cars, all houses, all boats).
What I just found is, if I hit refresh at the home page and click cars, then click a specific link to that car details, the timeline loads fine. If I select 'all cars' from the details page to go back to the 'all cars' page and go to the same details page again the timeline does not work. However if I click to go back to the 'all cars' page from the details page and click refresh there as I did on the home page, then go into the details page again, the timeline works.
This tells me it has something to do with how the library I am using is being initialized or something and once it has been loaded it wont allow it fire properly after that until the files are reloaded. I realize this is beyond the scope of the angular group here. I will have to put a post on the veriteco group and see if they can offer any advice.
Thanks for the help and input on the directive though, I like this simpler solution better, even if I dont completely understand how/why it works