2

Tracking and nutrition templates are called like below:

.state('app.tracking', {
    url: '/tracking',
    views: {
      'menuContent': {
        templateUrl: 'templates/tracking.html',
        controller: 'TrackingCtrl'
      }
    }
})

  .state('app.nutrition', {
      url: '/nutrition',
      views: {
          'menuContent': {
              templateUrl: 'templates/nutrition.html',
              controller: 'NutritionCtrl'
          }
      }
  })

When tracking route is called tracking.html will be displayed. I also want to display the nutrition.html inside the tracking.html when called.

So, in tracking.html I have included code like below:

  <ng-include src="templates/nutrition.html"></ng-include>

expecting that nutrition.html is also displayed inside tracking.html when my route is tracking.html. But not working. Anything missing here?

6
  • how you can named a directive with 'tracking.html'? what is your error msg? Commented Jun 10, 2016 at 16:31
  • tracking.html is a template..not directive..have edited the question..if that helps...there is no error message in console... Commented Jun 10, 2016 at 16:34
  • Have you checked the path? Commented Jun 10, 2016 at 16:39
  • yes..path is correct...previously it was throwing error on path..but i fixed it..no errors in console... Commented Jun 10, 2016 at 16:39
  • 1
    wrapping in single quotes working..thanks.. Commented Jun 10, 2016 at 16:56

1 Answer 1

3

Try wrapping your URL in single quotes. <ng-include src=" 'templates/nutrition.html' "></ng-include>

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.