Comments (4)
Hi raikage,
I use it within a "script" tag like this inside a template, and it works for me:
<script id="login.html" type="text/ng-template">
<div class="modal">
<header class="bar bar-header bar-positive">
<h1 class="title">Log-in</h1>
<button class="button button-clear" ng-click="closeModal()">Cancel</button>
</header>
<content has-header="true"
has-subheader="false"
has-footer="false"
overflow-scroll="false"
scroll="false"
on-refresh="onRefresh()"
padding="true">
<div class="list">
<label class="item item-input">
<span class="input-label">User</span>
<input type="text" placeholder="Type here">
</label>
<label class="item item-input">
<span class="input-label">Password</span>
<input type="text" placeholder="Type here">
</label>
<br/>
<button class="button button-balanced" ng-click="goTo('somewhere');">Enter</button>
</div>
</content>
</div>
</script>
Inside JS Controller file:
// Load the modal from the given template URL
$ionicModal.fromTemplateUrl('login.html', function(modal) {
$scope.modal = modal;
}, {
// Use our scope for the scope of the modal to keep it simple
scope: $scope,
// The animation we want to use for the modal entrance
animation: 'slide-in-up'
});
$scope.openModal = function() {
$scope.modal.show();
};
$scope.closeModal = function() {
$scope.modal.hide();
};
Let me know if it works fine for you.
/marc
from meteor-ionic.
this is what I do loneleeandroo/ngMeteor#9 (comment). put it inside a meteor template tag
<template name="login">
<script id="login.html" type="text/ng-template">
...
</script>
</template>
then putting {{> login}} inside a meteor template tag or body.
Wondering if this is the correct way of doing this or if there is a better way
from meteor-ionic.
I'm not sure if it's the correct way, but it works!
BTW, it was a mistake in my last example, because I used an old Ionic version. From v0.9.25+ they changed the Ionic Directive Naming (http://ionicframework.com/blog/ionic-directive-prefixes/), so you'll need to change them in your source code and it'll work.
from meteor-ionic.
I think this issue is solved, so I close it.
from meteor-ionic.
Related Issues (20)
- Ionic Dependencies HOT 2
- Inconsistencies with Ionic HOT 2
- Template Variables Treated As Strings HOT 7
- Update to Meteor 1.0.5 ends with error [ng:btstrpd] App Already Bootstrapped with this Element 'document' HOT 5
- Seeing <!DOCTYPE html> errors HOT 8
- Is it possible to hide the Safari address bar and tab-bar? HOT 1
- add this as Cordova only package HOT 2
- meteor add-platform ios does not work if app name starts with a number HOT 2
- Ionic doesn't init if index and meteorionic swapped HOT 2
- Ionic view HOT 2
- ionic tabs not work good! HOT 13
- Please address pull request HOT 1
- meteor-ionic and meteor-angular incompatible HOT 4
- ngcordova local file "Not allowed to load local resource" HOT 11
- ionic tabs seem to have a bug!
- Windows support HOT 1
- Hot code push or sending data 2 times to collection-repeat causes Maximum Stack Size Exceed HOT 1
- SASS support (for building ionic css) HOT 5
- Blog post HOT 1
- Ionic2 HOT 6
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 meteor-ionic.