Comments (2)
yieldTo
content is saved as a string in a variable and re-appended to its container as default each time a route changes thus it is compiled with $compile
just like the contentFor
content.
So the same would happen with an empty contentFor
.
Now the problem is that $compile
implicitly passes strings to angular.element
in order to convert it to a new dom element. If the string doesn't start with an html tag it assumes that is an attempt to use a jquery selector thus raising an error for the unsupported feature.
This is the code where the issue happens:
setContentFor: (name, content, scope) ->
b = yielders[name]
return unless b
sanitizedContent = content.replace(/^\s+/, "")
compiled = $compile( sanitizedContent )(scope)
b.element.empty().append(compiled)
A quick fix could be to check if sanitizedContent is empty and just empty yield-to accordingly. But it would not work with another string. The following would also raise an error:
<div class="navbar-brand navbar-brand-center" yield-to="title">
The title
</div>
So for now you can include an empty span if its not a problem.
<div class="navbar-brand navbar-brand-center" yield-to="title">
<span></span>
</div>
I wish to figure out a better and more generic workaround, do you know a better way to overcome this problem?
from mobile-angular-ui.
Ok I found the right way to do that in the ngInclude
source:
b.element.html(content)
$compile(b.element.contents())(scope)
Just released 1.0.7-beta
fixing this issue.
Thank you
from mobile-angular-ui.
Related Issues (20)
- movementThreshold option? HOT 1
- Modals not working now HOT 1
- Need of ui-mobile-option : Would solve some problems.
- confused between mobile-angular-ui and ionic framework..
- [Question] How to make mobile-angular-ui work with minimal-ui mode in iOS 8+
- ERROR: file not found ,when clicking on link using intel xdk
- Angular ui working perfectly on browser and intel xdk emulator.. but not working on real phone
- Uncaught ReferenceError: angular is not defined
- v1.3.4 mobile angular ui - how to add sub menu in the sidebar
- Replacing hamburger menu with a back button
- Could not resolve 'undefined' from state dropdown menu and ng-click
- How to integrate mobile-angular-ui with videogular?
- Radio [group] and slider not implemented
- ui-switch does not make form.$dirty or form.$pristine HOT 1
- how to run it HOT 2
- nodejs study resourse
- AngularJS 1.6 support
- FastClick causes freezing in iOS 11.3
- Open modal HOT 2
- ui-scroll-bottom stop working on chrome mobile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobile-angular-ui.