Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed hard coded interpolation #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions dist/angular-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,32 +100,34 @@ angular.module('cgPrompt').controller('cgPromptCtrl',['$scope','options','$timeo
}]);


angular.module('cgPrompt').run(['$templateCache', function($templateCache) {
angular.module('cgPrompt').run(['$templateCache', '$interpolate', function($templateCache, $interpolate) {
'use strict';
var istart = $interpolate.startSymbol();
var iend = $interpolate.endSymbol();

$templateCache.put('angular-prompt.html',
"<div>\n" +
" <div class=\"modal-header\">\n" +
" <button type=\"button\" class=\"close pull-right\" ng-click=\"$dismiss()\" aria-hidden=\"true\">×</button>\n" +
" <h4 class=\"modal-title\">{{options.title}}</h4>\n" +
" <h4 class=\"modal-title\">" + istart + "options.title" + iend + "</h4>\n" +
" </div>\n" +
" <div class=\"modal-body\">\n" +
"\n" +
" <p ng-if=\"options.message\">\n" +
" {{options.message}}\n" +
" " + istart + "options.message" + iend + "\n" +
" </p>\n" +
"\n" +
" <form id=\"cgPromptForm\" name=\"cgPromptForm\" ng-if=\"options.input\" ng-submit=\"submit()\">\n" +
" <div class=\"form-group\" ng-class=\"{'has-error':cgPromptForm.$invalid && changed}\">\n" +
" <label for=\"cgPromptInput\">{{options.label}}</label>\n" +
" <input id=\"cgPromptInput\" type=\"text\" class=\"form-control\" placeholder=\"{{options.label}}\" ng-model=\"input.name\" required ng-change=\"changed=true\" ng-if=\"!options.values || options.values.length === 0\"/ autofocus=\"autofocus\">\n" +
" <label for=\"cgPromptInput\">" + istart + "options.label" + iend + "</label>\n" +
" <input id=\"cgPromptInput\" type=\"text\" class=\"form-control\" placeholder=\"" + istart + "options.label" + iend + "\" ng-model=\"input.name\" required ng-change=\"changed=true\" ng-if=\"!options.values || options.values.length === 0\"/ autofocus=\"autofocus\">\n" +
" <div class=\"input-group\" ng-if=\"options.values\">\n" +
" <input id=\"cgPromptInput\" type=\"text\" class=\"form-control\" placeholder=\"{{options.label}}\" ng-model=\"input.name\" required ng-change=\"changed=true\" autofocus=\"autofocus\"/>\n" +
" <input id=\"cgPromptInput\" type=\"text\" class=\"form-control\" placeholder=\"" + istart + "options.label" + iend + "\" ng-model=\"input.name\" required ng-change=\"changed=true\" autofocus=\"autofocus\"/>\n" +
"\n" +
" <div class=\"input-group-btn\">\n" +
" <button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\"><span class=\"caret\"></span></button>\n" +
" <ul class=\"dropdown-menu pull-right\">\n" +
" <li ng-repeat=\"value in options.values\"><a href=\"\" ng-click=\"input.name = value\">{{value}}</a></li>\n" +
" <li ng-repeat=\"value in options.values\"><a href=\"\" ng-click=\"input.name = value\">" + istart + "value" + iend + "</a></li>\n" +
" </ul>\n" +
" </div>\n" +
" </div>\n" +
Expand All @@ -134,7 +136,7 @@ angular.module('cgPrompt').run(['$templateCache', function($templateCache) {
"\n" +
" </div>\n" +
" <div class=\"modal-footer\">\n" +
" <button ng-repeat=\"button in options.buttons track by button.label\" class=\"btn btn-default {{button.style}}\" ng-class=\"{'btn-primary':button.primary}\" ng-click=\"buttonClicked(button)\">{{button.label}}</button>\n" +
" <button ng-repeat=\"button in options.buttons track by button.label\" class=\"btn btn-default " + istart + "button.style" + iend + "\" ng-class=\"{'btn-primary':button.primary}\" ng-click=\"buttonClicked(button)\">" + istart + "button.label" + iend + "</button>\n" +
" </div>\n" +
"</div>"
);
Expand Down