angularjs - Is it possible to have multiple states on a page at once or change the state of a named view? -
angularjs - Is it possible to have multiple states on a page at once or change the state of a named view? -
i developing page has news feed on it; when think of logically, feed has several states on (news, settings, favorites, etc.).
a feed should able on many types of pages, such product or person or whatnot, way understand feed should have states because parent page can have sorts of other states feed not care about, , vice versa.
i can't figure out how accomplish -- @ first thought able accomplish using named view on parent page can't figure out if view can have state, or how code that.
how should implementing structure?
what looking sounds lot directive:
a directive has html template associated it a directive backs html template scope can (and should) independent of page scope, few explicitly defined parameters (values and/or functions) passed it a directive can define specific behaviours , functions, regular page via controller a directive can nonetheless communicate parent page, whether because shares scope (usually bad idea) or because there two-way binding of select fields optionally directive can communicate other directives (in application, useful if define "rss feed" directive , "rss news item" example)the states variables, of pass directive page, compute within directive. in turn parameterize directive html template usual angular behaviours (e.g. ng-hide/show subcomponents).
angular directive doc : https://docs.angularjs.org/guide/directive tutorial : http://www.sitepoint.com/practical-guide-angularjs-directives/
does reply question ?
angularjs angular-ui-router
Comments
Post a Comment