What could be causing the lack of space between the elements of form-inline?

Check out the demo here: http://jsfiddle.net/sunnycpp/MPACc/4/

Here is the same code pasted below: HTML

<div class="container">
  <debug-bar ng-controller="parentController">
    <debug-bar ng-controller="childController">
      <debug-bar ng-controller="oneMoreChildController"></debug-bar>
    </debug-bar>
    <debug-bar ng-controller="oneMoreChildController"></debug-bar>
  </debug-bar>
</div>

Javascript

var angModule = angular.module('components', []);
angModule.directive('debugBar', function () {
  return {
    restrict: 'E',
    template: 
    '<div>'+
        '<form class="form-inline">' +
            '<input type="text" class="input-small" ng-model="myText"/>' +
            '<button class="btn btn-primary">Broadcast</button>' +
            '<button class="btn btn-primary">Emit</button>' +
        '</form>' +
        '<div ng-transclude></div>'+
    '</div>',
    transclude: true,
    replace: true
  };
});


function createController(myText) {
  return function ($scope) {
    $scope.myText = myText;
    $scope.$on("event", function (senderText) {
      console.log("Event received in:" + $scope.myText + " from Sender:" + senderText);
    });
    $scope.$broadCastEvent = function () {
      $scope.$broadcast("event", $scope.myText);
      console.log("Sent event from:" + $scope.myText);
    };
  };
}

angModule.controller("parentController", createController("In parent"));

angModule.controller("childController", createController("in FirstChild"));

angModule.controller("oneMoreChildController", createController("in oneMoreChildController"));
angModule.controller("oneMoreChildController", createController("in secondLevelChild"));

Answer №1

Since there were no margins defined, the issue arose. jsfiddle and bootstrap eliminate the margins by default...

By setting margins, the problems were resolved

input,button{
 margin:0 5px;
}

View Example

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Connecting angular-cli to WebStorm

I am facing an issue with npm where it's not linking the global modules to command line. Angular-cli has been installed as a global module but WebStorm is unable to locate it. Is there a way to instruct WebStorm on where to look for angular-cli? ...

When the Angular script is executed, the variable is not defined

One of my custom directives receives an object named 'vm' in its scope, which contains a property/value pair (ccirCategoryIncidentI : 3) that I need to access. When I try to log this value with console.log(scope.vm.ccirCategoryIncidentI), it init ...

Angular JS is utilized to implement a unique pagination system for tables

I've been working on adding pagination to my code. So far, I've managed to add a specified number of rows after clicking the add button. However, I'm facing confusion when it comes to implementing custom pagination. Does anyone have any adv ...

What is the best way to replicate the orange outline when focused?

I am in the process of creating a series of divs that can be navigated by the user using the tab key. I would like to incorporate the standard orange focus outline for these elements. Is there anyone who can provide guidance on how to achieve this? I unde ...

The attribute 'checked' is not a valid property for the 'TElement' type

Learning about typescript is new to me. I have a functional prototype in fiddle, where there are no errors if I use this code. http://jsfiddle.net/61ufvtpj/2/ But in typescript, when I utilize this line - if(this.checked){ it presents an error [ts] Pro ...

Don't forget to keep track of when the user has closed

How can I ensure that the cache retains the user's action of closing the div? Currently, when I close the div and refresh the page, it reverts back to its original state. Is there a way to make this change persistent? Experience it live: Here is the ...

What should we name this particular style of navigation tab menu?

What is the name of this tab menu that includes options for next and previous buttons? Additionally, is there a material-ui component available for it? https://i.sstatic.net/0m9rH.png ...

Conceal elements within a div using the 'elementFromPoint' function

In my HTML, I have a div that contains an icon and some text. I want to make it so that when I hover over the div with my mouse, only the div itself is visible to the 'elementFromPoint' function. How can I achieve this? Here is an example of th ...

Ways to avoid overflow of dynamically added div element?

Currently, I am facing an issue while dynamically appending div elements with the .magnet class to my page. These elements end up overflowing the container boundaries and I am struggling to find a solution for this problem. If anyone could check out my j ...

Experiencing a 404 error while making an API PUT request with a route parameter

In my Express app, I am attempting to hit the following API url: // Dashboard API for updating accounts app.post('/api/accounts/:id', accountsController.update); Below is my complete accounts module with Accounts factory and specific descriptio ...

Utilizing jQuery time intervals within a jQuery click event: A step-by-step guide

For my dropdown menu project, I am facing an issue where the menu bar is not reappearing after collapsing the dropdown. It seems that the jQuery function responsible for toggling classes within a time interval is not executing properly. Specifically, the " ...

Adjust the stacking order to remove focus from the text field

Currently, I am facing an issue with my search box not unfocusing when clicked. My goal is to have the search box lose focus when anything on the page is clicked, especially the background (div.bb). The elements positioned above the background are set to p ...

Is it possible to dynamically change the background image using ReactJS?

I attempted to dynamically change the background image style for the div below: Below is my code snippet for implementation: render: function() { var divImage = { backgroundImage : "url(" + this.state.song.imgSrc + "),url(" + this.state.nextImgSrc ...

AngularJS directive is throwing an error regarding an unknown provider

Upon loading my modal in the AngularJS application, an error message is displayed: $injector:unpr Unknown Provider Unknown provider: eProvider <- e The directive implemented is as follows: (function () { angular.module('myApp').d ...

Unable to set DIV to 'inline-block' or none based on checkbox selection

Despite reviewing multiple examples, I am still struggling to make this DIV visible and hidden by clicking a checkbox. Can someone please review my JavaScript code? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Conten ...

Error message: "Issue occurs when sending keys to protractor element's text value and

Having trouble running this code in Protractor as I keep encountering errors, and I'm unable to retrieve the value of the anpr_box_input text. Error message: ManagedPromise::871 {[[PromiseStatus]]: "pending"} failed - should have a valid license ...

Run the script within the Angular scope

Hey there! I'm having an issue passing a JavaScript code through Angular scope, but when it renders on the view page, it's displayed as text. I even attempted using ng-Sanitize, but unfortunately, that didn't solve the problem. &lt;div ...

Downloading PDF files with Angular

I am working with an angular function that retrieves pdf data from the server: printDocument: function (bundleId, policyId) { var fileName = "test.pdf"; var a = document.createElement("a"); document.body.appendChild(a); ...

karma jasmine along with angular ng-cookies

I encountered an error while testing my application with ng-cookies. The error message reads: TypeError: $browser.addPollFn is not a function in static/js/angular/ng-cookies_1.3.13.js (line 60) After researching online, I discovered that the version of ...

Utilizing AngularJS to create a cascading drop-down menu

I am attempting to create a cascading drop-down menu where the second drop-down will display options related to the item selected in the first drop-down box. However, even after trying some sample code, the second drop-down remains empty. Here is the HTML ...