ng-view html showing as plain string. how can I fix it?
Error screenshot.
https://www.evernote.com/shard/s179/sh/b7cf9275-7d18-4b5d-8599-a4b7ec5c3bbc/c9ec67b08744057a3a78ab4f20dd97aa
Sorry, i can not upload images.
Looks like you're trying to use ng-view to load jade/haml? You'll need to have that compile to html before angular will be able to use it as a view.
Related
I am trying to load a JSP page inside a modal in AngularJS.
The JSP page have lot of scripts and so I wont be able to take the source and create a separate template. The URL is from a different server but I have CORS enabled in my server. Is there someway we can include the file in a div using ng-include src=""? I already tried this but it is not working. Can anyone recommend a solution?
You are not writing a valid code the code should be like this:
<div ng-include="'file path'"></div>
Note: Make sure of single inverted comma within double inverted comma. And file path can be of your any absolute path. Do not write src while using ng-include.
I want to be able to create a simple directive that will be used for loading and removing an image file. Can anyone help?
I would like to be able to specify in html something like
<my-image image={{object.image}} newFile={{object.newImage}}> </my-image>
The directive will show the current, allow replacing it and removing. Result will be in object.newImage.
Did anyone came across anything similar?
I can't make the ng-include directive work. I've watched and tried several solutions from stackoverflow but none of them seems to be working. Am I missing something ? Angular works everywhere in the document, except for this. The div is not emebeded in anything.
I am using the foundation framework. Is it possible that it causes the problem ?
Here is the code in my index.html:
<div ng-include="'partials/menu.html'"></div>
I checked and rechecked, I DO have a "partials" folder containing a "menu.html" file...
I have also tried:
<div ng-include src="'partials/menu.html'"></div>
and
<div ng-include="'/partials/menu.html'"></div>
Thanks in advance for any help you could give me !
You have the correct code here:
<div ng-include=" 'partials/menu.html' "></div>
so it's most likely a path issue. If your partials folder is not inside the same folder as the html file you're calling the partial into, you might need something like '../partials/menu.html'. You might try creating a simple 'hello world' like partials/test.html with no angular functionality and use that to find the correct path and get your ng-include working.
Thanks for your answer. I actually figured out what the problem was. It seems you cannot do http requests in chrome on a local file. The console showed an error about that. I tried opening the file in firefox and it worked. I assume this error will not occure once the file is uploaded on a server.
The issue is the use of single and double quotation, you only need one of them, like this:
<div ng-include="partials/menu.html"></div>
This works as well
<div ng-include='partials/menu.html'></div>
I've been scratching my head for some time over this puzzle. I've been trying to load an external file into an ng-view (no problems here). And in that partial file I have text that get swapped for an input field when you click "Edit title", but this only works when all code is included in the same file.
If you take a look at this Plunker http://plnkr.co/edit/cgUGOKVzWKNWugqrFCbJ you'll see what I mean.
I would appreciate if you could point me in a direction that could solve this issue for me.
Thanks!
The "#" in the hrefs are probably making angular render the html and the controller again.
Change them as below and it should work:
Edit title
UIWebView is loaded with a long html. How to paginate the UIWebView, without the content or image in it getting cut? I have tried using ePubjs but not sure how it works! Can anyone help?
There is JavaScript file contain function for pagination google it, and also you need to inject your HTML file to insert the HTML tags needed to make the pagination function work.