javascript - How do I allow for clicking on each item/post, then viewing it in a new screen? -


Trying to create a simple tutorial app listing of grocery items, and after clicking on it, a new one The page will display groceries details such as price, quantity left etc.

Currently, clicking on the Comments button does nothing. I see a smoothness in the URL but it comes back in my original post url There is no syntax problem so far.

I doubt it can be either by giving the names of states or angular conferences. Module definition has gone wrong Can someone please me? Thanks!

('Tab', {url: '/ tab', abstract: true, templates: 'template / tabs.HTML'}) .state ('tab.posts', {url:' / posts', view: {'tab - Post ': {template: url:' templates / tab-posts.html ', Controller:' PostsCtrl '}}}) .state (' tab.view ', {// Suspicious error is here, but different combos Did not work: '/ post /, post id', view: {'tab-view': {templateUrl: 'Templates / tab-showpost.html', Controller: 'PostViewCtrl'}}})


this postview.jsf Ile

  var app = angular. Module ('app.controllers.view', []) // Error even if it is removed line app.controller ( 'PostViewCtrl', function ($ scope, $ state page, post) {$ scope.post = Post.find ($ stateParams.postId);});  


This tab is showpost.html.

   


This tab is-post.html

  & lt; Form ng-submit = "submitPost ()" & gt; & Lt; Input type = "text" ng-model = "post.title" /> & Lt; Input type = "text" ng-model = "post.url" /> & Lt; Input type = "submit" value = "add post" / & gt; & Lt; / Form & gt; & Lt; Div ng-repeat = "post (post id, post)" in the post "& gt; & Lt; A href = "{{post.url}}" & gt; {{Post.title}} & lt; / A & gt; & Lt; A href = "# / post / {{postId}}" & gt; Comments & lt; / A & gt; & Lt; / Div & gt;  

I think it can not solve your url, maybe Is it URL # / tab / post / {{postId}} that you name your routes and how they inherit each one?

Otherwise you can try and see that it works with ^ to make the root route and does not have a parent's relatives.

To do the job of the url,

  .state ('tab.view', {// the suspicious error is here, but different combos url has not worked : '^ / Post /: post id', view: {'tab-view': {templateUrl: 'templates / tab-showpost.html', Controller: 'PostViewCtrl'}}})  

The other will take it on the path relative to their parents, in this case the tab if I am right and url on it is # / tab / posts / {{postId}}.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -