Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Accept template string modal #732

Closed
j1n6 opened this issue Apr 29, 2014 · 6 comments
Closed

Accept template string modal #732

j1n6 opened this issue Apr 29, 2014 · 6 comments

Comments

@j1n6
Copy link

j1n6 commented Apr 29, 2014

Do you think that template options should also accept template string like "<div>....</div>".

This would be useful, use-case would be options of using other template cache instead of the builtin $templateCache.

Option line:
https://github.com/mgcrea/angular-strap/blob/master/src/modal/modal.js#L13

@mgcrea mgcrea changed the title Accept template string Accept template string modal May 28, 2014
@scottopherson
Copy link

+1

I was hoping to have this functionality with a Browserify project I was working on recently:

var modal = $modal({ template: require('path/to/template.html'), ... });

Directives and routes allow you to do template strings or paths:

.directive('myDirective', function () {
  return {
    link: function () {},
    template: require('path/to/template.html') // "<div>content</div>"
    // or.. 
    templateUrl: 'path/to/template.html'
  });

.when('/myRoute', {
  controller: function () {},
  template: require('path/to/template.html') // "<div>content</div>"
  // or.. 
  templateUrl: 'path/to/template.html'
});

@mgcrea mgcrea closed this as completed in 8e54db8 Jul 12, 2015
mgcrea added a commit that referenced this issue Jul 12, 2015
…or `controller`, `controllerAs`, `template`, `templateUrl` options (fixes #732, fixes #728, fixes #1394, fixes #1735)
mgcrea added a commit that referenced this issue Jul 12, 2015
…or `controller`, `controllerAs`, `template`, `templateUrl` options (fixes #732, fixes #728, fixes #1394, fixes #1735)
@mgcrea
Copy link
Owner

mgcrea commented Jul 12, 2015

Finally took the time to backport the bsCompiler from angular-material's project. You can now use controller, controllerAs, templateUrl and template options in your modal and derivatives. Hope it solves most of the issues you encountered with AngularStrap's modals.

@scottopherson
Copy link

Awesome 👍

@stanislav-ostapenko
Copy link

stanislav-ostapenko commented Nov 23, 2016

@scottopherson Is it possible to do something like this? I am using a webpack and looks like this doesn't work.

$modal({ template: require('./template.html'), show: true });

@stanislav-ostapenko
Copy link

Sorry for disturbing. I have update angular-strap and now it works perfect. Thank you anyway.

@lock
Copy link

lock bot commented Jan 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the outdated label Jan 25, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants