Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              .container{:'ng-app' => 'modalTest',:'ng-controller' => 'dialogServiceTest'}
        Dialog Service Demo 
        %small (with i18n capabilities)
        %small (Bootstrap 3.1.1, AngularJS 1.2.16, Angular UI Bootstrap 0.11.0, Angular-Translate)
      %p Demo of Angular dialog service using Bootstrap 3.1.1 with Angular &amp; Angular UI Bootstrap's modal service (0.11.0).
        As well as the use of 
        %a{:href => ''} Angular-Translate (
        This demo shows the ability to use different languages with your dialogs as well as switch lanugages on the fly (This works for the preset dialogs only, for the custom ones you need to set that up yourself - for obvious reasons).  You can also now set the size of the modal/dialog either small (sm) or large (lg), requires Bootstrap 3.1.1 and Angular-UI-Bootstrap 0.11.0.  In previous versions of the  "angular-dialog-service"
        %a{:href=>''} (
        the two way "binding" between a custom dialog and its calling controller was always decoupled, now the two way  "binding" can be retained by using the "dialogsProvider.useCopy(false)."
      %button.btn.btn-danger{:'ng-click'=>"launch('error')"} Error Dialog
      %button.btn.btn-primary{:'ng-click'=>"launch('wait')"} Wait Dialog
      %button.btn.btn-default{:'ng-click'=>"launch('notify')"} Notify Dialog
      %button.btn.btn-success{:'ng-click'=>"launch('confirm')"} Confirm Dialog
      %button.btn.btn-warning{:'ng-click'=>"launch('custom')"} Custom Dialog
      %button.btn.btn-warning{:'ng-click'=>"launch('custom2')"} Custom Dialog 2
        %strong Confirmation:
        %strong Name Enter(From Custom):
        %strong Custom 2 Value:
        %strong Current Language:
      %button.btn.btn-default{:'ng-click'=>"setLanguage('en-US')"} English
      %button.btn.btn-default{:'ng-click'=>"setLanguage('es')"} Spanish
		//-- Variables --//
		$scope.lang = 'en-US';
		$scope.language = 'English';

		var _progress = 33;
		$ = '';
		$scope.confirmed = 'No confirmation yet!';
		$scope.custom = {
			val: 'Initial Value'
		//-- Listeners & Watchers --//

				case 'en-US':
					$scope.language = 'English';
				case 'es':
					$scope.language = 'Spanish';

		//-- Methods --//

		$scope.setLanguage = function(lang){
			$scope.lang = lang;

		$scope.launch = function(which){
				case 'error':
				case 'wait':
					var dlg = dialogs.wait(undefined,undefined,_progress);
				case 'notify':
				case 'confirm':
					var dlg = dialogs.confirm();
						$scope.confirmed = 'You confirmed "Yes."';
						$scope.confirmed = 'You confirmed "No."';
				case 'custom':
					var dlg = dialogs.create('/dialogs/custom.html','customDialogCtrl',{},'lg');
						$ = name;
							$ = 'You did not enter in your name!';
				case 'custom2':
					var dlg = dialogs.create('/dialogs/custom2.html','customDialogCtrl2',$scope.custom,'lg');
		}; // end launch
		var _fakeWaitProgress = function(){
				if(_progress < 100){
					_progress += 33;
					$rootScope.$broadcast('dialogs.wait.progress',{'progress' : _progress});
	}) // end controller(dialogsServiceTest)
		//-- Variables --//

		$scope.user = {name : ''};

		//-- Methods --//
		$scope.cancel = function(){
		}; // end cancel
		$ = function(){
		}; // end save
		$scope.hitEnter = function(evt){
			if(angular.equals(evt.keyCode,13) && !(angular.equals($,null) || angular.equals($,'')))
	}) // end controller(customDialogCtrl)
		$ = data;
		//-- Methods --//
		$scope.done = function(){
		}; // end done

			DIALOGS_ERROR: "Error",
			DIALOGS_ERROR_MSG: "Se ha producido un error desconocido.",
			DIALOGS_CLOSE: "Cerca",
			DIALOGS_PLEASE_WAIT: "Espere por favor",
			DIALOGS_PLEASE_WAIT_ELIPS: "Espere por favor...",
			DIALOGS_PLEASE_WAIT_MSG: "Esperando en la operacion para completar.",
			DIALOGS_NOTIFICATION: "Notificacion",
			DIALOGS_NOTIFICATION_MSG: "Notificacion de aplicacion Desconocido.",
			DIALOGS_CONFIRMATION: "Confirmacion",
			DIALOGS_CONFIRMATION_MSG: "Se requiere confirmacion.",
			DIALOGS_OK: "Bueno",


  		$templateCache.put('/dialogs/custom.html','<div class="modal-header"><h4 class="modal-title"><span class="glyphicon glyphicon-star"></span> User\'s Name</h4></div><div class="modal-body"><ng-form name="nameDialog" novalidate role="form"><div class="form-group input-group-lg" ng-class="{true: \'has-error\'}[nameDialog.username.$dirty && nameDialog.username.$invalid]"><label class="control-label" for="course">Name:</label><input type="text" class="form-control" name="username" id="username" ng-model="" ng-keyup="hitEnter($event)" required><span class="help-block">Enter your full name, first &amp; last.</span></div></ng-form></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="cancel()">Cancel</button><button type="button" class="btn btn-primary" ng-click="save()" ng-disabled="(nameDialog.$dirty && nameDialog.$invalid) || nameDialog.$pristine">Save</button></div>');
  		$templateCache.put('/dialogs/custom2.html','<div class="modal-header"><h4 class="modal-title"><span class="glyphicon glyphicon-star"></span> Custom Dialog 2</h4></div><div class="modal-body"><label class="control-label" for="customValue">Custom Value:</label><input type="text" class="form-control" id="customValue" ng-model="data.val" ng-keyup="hitEnter($event)"><span class="help-block">Using "dialogsProvider.useCopy(false)" in your applications config function will allow data passed to a custom dialog to retain its two-way binding with the scope of the calling controller.</span></div><div class="modal-footer"><button type="button" class="btn btn-default" ng-click="done()">Done</button></div>')

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.