Friday 15 July 2011

architecture - Basic behaviour and structure of an angularjs app -


I am trying to present myself in the context.

Although I have worked through the tutorial and have seen basic building video, I still struggle with more or less applications and architecture of applications.

There is a menu bar in my app that contains an add-button if the user clicks the button, then I want a dialog to pop-up this is not part of the dialog menu:

  & lt ;! - Menu - & gt; & Lt; Header class = "mod modHeader" ng-controller = "HeaderCtrl" & gt; & Lt; Div class = "modHeader__addProject" ng-click = "open edlieg ()" & gt; & Lt; I class = "icon-plus icon -2x" & gt; & Lt; / I & gt; & Lt; / Div & gt; & Lt; / Header & gt; & Lt ;! - dialog - & gt; & Lt; Div class = "modNewProject" ng-show = "attribute.administrative visibility" ng-controller = "header ctrl" & gt; & Lt ;! - Content stripped - & gt; & Lt; / Div & gt;   

My intent was to create an properties object inside my HeaderCtrl controller's circle, then click a bullion value by clicking the button.

  // Header Ctrl Function Header Ctrl ($ Scope) {$ scope.properties = {"AddDialogVisibility": Incorrect}; $ Scope.openAddDialog = function () {$ scope.properties.AddDialogVisibility = true; }; }   

Now, there are many issues and questions:

  • In order to gain access to the property of the properties, I have to apply header Ctrl to my dialog. It's bad for me, HeaderCtrl can only control my header module, right?
  • The dialog will not appear on the click I came to know that this is because the property is checked only once on page load, and I have to use the function. What is the proper way to achieve my goal?

    Conclusion:

    I would say that I can summarize my question in the following:
    I will see every section of my page How do I communicate with a controller?

    In the sample code you provided, two header CTLLs will be created. Each use of the ng-controller will create a controller

    To share data in the corner, use one where the service inject - in controllers, instructions, etc.

    When designing a Konalar app, try to think in terms of the model (which is often used in the services, and then application in the rest of those services) and the Controller of Thinking is the only Gum Allows us to project relevant parts of our models in one view.

    Since then, the dialogue is a special / unique matter, because listen to this topic. I will also see how the Konari-UI team implemented the dialog:

No comments:

Post a Comment