ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

$templateCache doesn't seem to work with ionic

Open iwoogy opened this issue 12 years ago • 9 comments

Hello,

I've been developping few apps in Angular Js and Phonegap, and I'm converting my process to use ionic as my defaut framework, because you did an amazing job with ionic.

In my dev process, I heavily use the $templateCache to optimize the performance as much as possible.

I've created a basic structure with 2 modules (Module1,Module2) and included it in a main module that imports Module1 and Module2 and configure the states for switching between 2 modules.

If I use ui-view from ui-router, it works, but when I use ion-nav-view, it does not seem to work.

This is my plunkr to illustrate this point :

http://plnkr.co/edit/e9KxoM6PqNeTEWjJNMfi?p=preview

I may have done something wrong. Please help me to understand what happened for me to leverage the power of ionic soon.

Thanks

Best Regards

Bobby

iwoogy avatar May 07 '14 16:05 iwoogy

You can change your css. Inspect the element and figure out exactly what rules you need to apply.

.selected a.item-content {
  background: lightcoral;
}

Just be sure your css selector is specific enough to overwrite the defaults.

EDIT: answered wrong issue.

ajoslin avatar May 07 '14 17:05 ajoslin

Hello

Thanks for your answer.

But I hardly understand how it could be a css issue in this case. Let me explain my test in plunkr to avoid you reading it.

  1. This is the ion-nav-view : image
  2. When I inspect it, nothing appears in the div, even if I click on the button Route 1 and Route 2 : image
  3. I comment the ion-nav-view div and I add ui-view directive from ui-router, and in this case, it works, the view appears and change on click on Route 1 and Route 2 links : image

Do you have any ideas why it does not work ?

Thanks

Bobby

iwoogy avatar May 07 '14 18:05 iwoogy

I answered the wrong issue. My apologies.

ajoslin avatar May 07 '14 18:05 ajoslin

Hello

OK No problem. Can you open the again ?

Thanks

Bobby

iwoogy avatar May 08 '14 01:05 iwoogy

I'll take a look tomorrow

ajoslin avatar May 08 '14 01:05 ajoslin

Hello Guys,

Any news about this bug. I'm eager to use ionic framework for my new projects coming next week. But my workflow use extensively $templateCache.

So I cannot use ionic with this pending issue.

Can anyone have a look ? It would be awesome.

Thanks

Best Regards

Bobby

iwoogy avatar Jun 06 '14 05:06 iwoogy

This is very weird, because it should work as is.

ajoslin avatar Jun 06 '14 18:06 ajoslin

Your plunker had two problems:

  1. You didn't include module 'ionic' as a dependency
  2. You were using ion-nav-view as an attribute directive, while it is in fact an element directive.

Fixed plunker: http://plnkr.co/edit/CrFZJOU0bzdEmBbJZLUK?p=preview

ajoslin avatar Jun 06 '14 18:06 ajoslin

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 06 '18 10:09 ionitron-bot[bot]